Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On progress bar please of information what type of data is being imported #232

Open
dmugtasimov opened this issue Aug 31, 2020 · 2 comments

Comments

@dmugtasimov
Copy link

No description provided.

@smithdc1
Copy link

smithdc1 commented Oct 3, 2020

What would this project think about adding a depenedncy with click to manage the cli?

Just a thought as I know some projects are strongly against dependencies.

Click has some nice API features, this feature could be added via:

https://click.palletsprojects.com/en/7.x/utils/

@thisisnotmyuserid
Copy link

You can see what type of information that is being imported by using the verbosity flag like this:

./manage.py cities_light --progress -v 3

combined with the example logging configuration:

    'version': 1,
    'disable_existing_loggers': False,
    'formatters': {
        'simple': {
            'format': '%(levelname)s %(message)s'
        },
    },
    'handlers': {
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'simple'
        },
    },
    'loggers': {
        'cities_light': {
            'handlers': ['console'],
            'propagate': True,
            'level': 'DEBUG',
        },
        # also use this one to see SQL queries
        'django': {
            'handlers': ['console'],
            'propagate': True,
            'level': 'DEBUG',
        },
    }
} 

this will give you an output like this:

DEBUG (0.001) SELECT COUNT(*) AS "__count" FROM "home_contactformfield" WHERE "home_contactformfield"."clean_name" = ''; args=('',)
INFO Downloading http://download.geonames.org/export/dump/countryInfo.txt into /usr/local/lib/python3.8/site-packages/cities_light/data/countryInfo.txt
INFO Importing countryInfo.txt
RAM used: 81 MB Time:  0:00:00 Done: 100%|#############################################################################################################################################|
INFO Downloading http://download.geonames.org/export/dump/admin1CodesASCII.txt into /usr/local/lib/python3.8/site-packages/cities_light/data/admin1CodesASCII.txt
INFO Importing admin1CodesASCII.txt
RAM used: 81 MB Time:  0:00:00 Done: 100%|#############################################################################################################################################|
INFO Downloading http://download.geonames.org/export/dump/admin2Codes.txt into /usr/local/lib/python3.8/site-packages/cities_light/data/admin2Codes.txt
INFO Importing admin2Codes.txt
RAM used: 83 MB Time:  0:00:01 Done: 100%|#############################################################################################################################################|
INFO Downloading http://download.geonames.org/export/dump/cities15000.zip into /usr/local/lib/python3.8/site-packages/cities_light/data/cities15000.zip
INFO Importing cities15000.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants