Saravanan666/pypi-org huggingface dataset:
Package: django-geo
A Django application which manage administrative geographical data.
It use Modified Preorder Tree Traversal, provided by django-mptthttps://github.com/django-mptt/django-mptt/Geo is not intented to replace a GIS, but to manage all the cases where you have
administrative trees, with a strict/lazy hierarchy.ModelsCountryAreaLocationAdministrativeAreaTypeCurrencyExamplesThree levelsitaly=Country.objects.get(iso_code='IT')regione,__=italy.administrativeareatype_set.get_or_create(name='Regione')provincia,__=italy.administrativeareatype_set.get_or_create(name='Provincia',parent=regione)comune,__=italy.administrativeareatype_set.get_or_create(name='Comune',parent=provincia)lazio,__=AdministrativeArea.objects.get_or_create(country=italy,name='Lazio',type=regione)roma_provincia,__=AdministrativeArea.objects.get_or_create(country=italy,name='Provincia di Roma',type=provincia,parent=lazio)roma_comune,__=AdministrativeArea.objects.get_or_create(country=italy,name='Comune di Roma',type=comune,parent=roma_provincia)city,__=LocationType.objects.get_or_create(description='CITY')roma,__=Location.objects.get_or_create(country=italy,name='Roma',type=city,area=roma_comune)Two levelsus=Country.objects.get(iso_code='US')state,__=italy.administrativeareatype_set.get_or_create(name='State')county,__=italy.administrativeareatype_set.get_or_create(name='County',parent=state)ny,__=AdministrativeArea.objects.get_or_create(country=us,name='New York',type=state)columbia,__=AdministrativeArea.objects.get_or_create(country=us,name='Columbia',type=county,parent=ny)city,__=LocationType.objects.get_or_create(description='CITY')hudson,__=Location.objects.get_or_create(country=us,name='Hudson',type=city,area=columbia,is_administrative=True)LinksStableDevelopmentProject home page:https://github.com/saxix/django-geoIssue tracker:https://github.com/saxix/django-geo/issues?sortDownload:http://pypi.python.org/pypi/django-geo/Documentation:https://django-geo.readthedocs.org/en/latest/
Package: django-geoaxis
A Django authentication backend forGeoAxISOAuth.requirementspip install git+ssh://git@github.com:boundlessgeo/django-geoaxis.git#egg=django_geoaxislocal_settings.py (example)importosfromdjango.confimportsettingsdefisValid(v):ifvandlen(v)>0:returnTrueelse:returnFalseSOCIAL_AUTH_NEW_USER_REDIRECT_URL='/'DEFAULT_AUTH_PIPELINE=('social_core.pipeline.social_auth.social_details','social_core.pipeline.social_auth.social_uid','social_core.pipeline.social_auth.auth_allowed','social_core.pipeline.social_auth.social_user','social_core.pipeline.user.get_username','social_core.pipeline.mail.mail_validation','social_core.pipeline.social_auth.associate_by_email','social_core.pipeline.user.create_user','social_core.pipeline.social_auth.associate_user','social_core.pipeline.social_auth.load_extra_data','social_core.pipeline.user.user_details')SOCIAL_AUTH_GEOAXIS_KEY=os.getenv('OAUTH_GEOAXIS_KEY',None)SOCIAL_AUTH_GEOAXIS_SECRET=os.getenv('OAUTH_GEOAXIS_SECRET',None)SOCIAL_AUTH_GEOAXIS_HOST=os.getenv('OAUTH_GEOAXIS_HOST',None)OAUTH_GEOAXIS_USER_FIELDS=os.getenv('OAUTH_GEOAXIS_USER_FIELDS','username, email, last_name, first_name')SOCIAL_AUTH_GEOAXIS_USER_FIELDS=map(str.strip,OAUTH_GEOAXIS_USER_FIELDS.split(','))OAUTH_GEOAXIS_SCOPES=os.getenv('OAUTH_GEOAXIS_SCOPES','UserProfile.me')SOCIAL_AUTH_GEOAXIS_SCOPE=map(str.strip,OAUTH_GEOAXIS_SCOPES.split(','))ENABLE_GEOAXIS_LOGIN=isValid(SOCIAL_AUTH_GEOAXIS_KEY)ifsettings.SITEURL.startswith('https'):SOCIAL_AUTH_REDIRECT_IS_HTTPS=True# GeoAxisOAuth2 will cause all login attempt to fail if# SOCIAL_AUTH_GEOAXIS_HOST is NoneifENABLE_GEOAXIS_LOGIN:settings.AUTHENTICATION_BACKENDS+=('django_geoaxis.backends.geoaxis.GeoAxisOAuth2',)login template additionAdd the following to your login template.{% if ENABLE_GEOAXIS_LOGIN %}<aclass="btn-geoaxis btn-social btn bg-ms btn-block"href="{% url 'social:begin' 'geoaxis' %}?{{ redirect_field_name }}={{ redirect_field_value }}"><iclass="fa fa-lock"></i>Log In with GeoAxis</a>
Package: django-geo-chile
Django Geo Chile 🇨🇱Models and management command to load Chile's Administrative Geographical data from official source.Getting Started1) Download packageUsing poetrypoetry add django_geo_chileUsing pipenvpipenv install django_geo_chileUsing pippip install django_geo_chile2) Add to settingsInsettings.pyaddgeo_chiletoINSTALLED_APPSINSTALLED_APPS = [
    ...
    "geo_chile",
]3) Create database tablesIn terminal run:python manage.py migrate4) Load dataIn terminal run:python manage.py load_geo_chile_data5) Drink Wine 🍷
Package: django-geocoding
Abstract base models and mixins to store address and GPS coordinates infoFree software: MIT licenseDocumentation:https://django-geocoding.readthedocs.io.FeaturesAbstractLocation base model with opencage geocoding supportDemoTo run an example project for this django reusable app, click the button below and start a demo serwer on HerokuQuickstartInstall Django geocoding for models:pip install django-geocodingAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'django_geocoding.apps.DjangoGeocodingConfig',...)Add Django geocoding for models’s URL patterns:fromdjango_geocodingimporturlsasdjango_geocoding_urlsurlpatterns=[...url(r'^',include(django_geocoding_urls)),...]Running TestsDoes the code actually work?::$ pipenv install –dev
$ pipenv shell
$ toxWe recommend usingpipenvbut a legacy approach to creating virtualenv and installing requirements should also work.
Please installrequirements/development.txtto setup virtual env for testing and development.CreditsThis package was created withCookiecutterand thewooyek/cookiecutter-django-appproject template.History0.1.0 (2017-12-27)First release on PyPI.
Package: django-geodata
django-geodataDjango app to add GEO data [Countries, Cities, Time Zones, Geo Points and their Polygons in geoJSON format.]InstallDownload Django app packege:pip require django-geodataAdd to your djangosettings.pyfile database connection settings forgeodatatable:DATABASE_ROUTERS = ['geodata.databaserouter.GeodataRouter']
 DATABASE_APPS_MAPPING = {'geodata': 'geodata'}
 DATABASES = {
     'geodata': {
     'ENGINE': 'django.contrib.gis.db.backends.postgis',
     'NAME': 'geodata',
     'USER': 'postgres',
     'PASSWORD': 'Postgres911!',
     'HOST': 'localhost',
     'PORT': '5432'
 }Insettings.pyregistergeodatain Django Apps list:INSTALLED_APPS = [
 	'geodata'
 ]Add to your djangourls.py:urlpatterns = [
    path('api/', include('geodata.urls')),
]Seed geo data for example Russia (contry code = RU) data or use US, GB, FR, DE or other valid country codepython manage.py seedcountry RUpython manage.py runserver
Package: django-geodz
django-geodz is a simple django app that provides out of the box algerian province and municipality
models and their respective data fixtures.you can use it for your own algeria-related projectsalso included:admin supportfr locale translationsupport for both django 1.7 migrations, aswell as south migrations (requires atleast south 1.0)Requirementsdjango-geopositionQuick startAdd “geodz” to your INSTALLED_APPS setting like this:INSTALLED_APPS = (
    ...
    'geoposition',
    'geodz',
)Runpython manage.py migrateto create/migrate the models and load the data fixtures.use the provided models:from geodz.models import Province, MunicipalityProfit !!!!ChangelogApril 25th, 2015newRegionmodelprovinces now have a one-to many foreign key to regionsinitial data fixture updatedsouth migrations deprecated / no longer supported / kept as is
Package: django-geoexplorer
django-geoexplorerallows you to useGeoExplorerin yourDjangoprojects.This is just packaging work for the boundless suite client sdk.The releases will be done loosely based on the suite releases but the minor version numbers may not match.INSTALLpip install django-geoexplorerUSAGEAddgeoexplorerto yourINSTALLED_APPSAUTHORSAriel Núñez <http://ingenieroariel.com>Alessio Fabiani <http://www.geo-solutions.it>DEVELOPERSgit clonehttp://github.com/GeoNode/suite.gitcd suite
git submodule update –init
cd ../
git clonehttp://github.com/GeoNode/django-geoxplorer.gitcp -R suite/geoexplorer/target/geoexplorer/WEB-INF/app/static/* django-geoexplorer/geoexplorer/static/
cd django-geoexplorer
git add geoexplorer/static
vim setup.py  # update the version number
git add setup.py
git commit -m “Commit committed, a new release was needed because the other one was old.”
git push origin master
python setup.py sdist uploadGeoExplorer Sourcesgit clonehttps://github.com/GeoNode/geoexplorer.gitcd geoexplorer
git checkout geonode-geoexplorer
ant war
cp -R suite/geoexplorer/target/geoexplorer/WEB-INF/app static/* django-geoexplorer/geoexplorer/static/LICENSELesser GNU Public LicenseOpenGeo Suite License - GPL
Package: django-geofield
Django-GeoField=====![](https://api.travis-ci.org/joway/django-geofield.svg?branch=master)A lightweight Django Geo Field to save and handle Geo Points. It supports to search the nearby points by their geohash.Quick start-----------0. Install django-geofieldpip install django-geofield1. Define GeoPositionField in your Model like this::class Point(models.Model):...position = GeoPositionField(db_index=True)2. Run `python manage.py makemigrations` and `python manage.py migrate` to make it effect3. The field will save a geo point with a string into database like this :Point.objects.create(position=GeoPosition(lat, lon, precision=6))'wtmm7w,30.49145747305400533377905958332121372222900390625,120.042387425481223317547119222581386566162109375'4. If you want to query the points whose geohash is matched exactly with the given point , you can :pos = Point.objects.get(id=1)points_matched = Point.objects.filter(position__geoprecise=pos.position.geohash)The '__geoprecise' lookup will find all points have the same geohash.5. If you want to query the points in expand area to eliminate the geohash's marginal error, you can :pos = Point.objects.get(id=1)points_matched = Point.objects.filter(position__geosearch=pos.position.geohash)The '__geosearch' lookup will find all points have one of 9 ( 1 center point and 8 expand point) geohash .6. If you want to query the points within a specific range , you should lookup the geohash table to get the geohash length you want, then just search the cropped length.pos = Point.objects.get(id=1)points_matched = Point.objects.filter(position__geosearch=pos.position.geohash[0:4])![](http://images.cnitblog.com/blog/522490/201309/09185913-9f6f65fc3d3c40ecb3328970831c625c.png)#### PS:If you want to limit the distance strictly, you should writer your own codes to filter the result .About GeoHash------[Wikipedia](http://en.wikipedia.org/wiki/Geohash)Support------python:- "2.7"- "3.2"- "3.3"- "3.4"- "3.5"- "3.5-dev" # 3.5 development branch- "nightly" # currently points to 3.6-devThanks------[python-geohash](https://github.com/hkwi/python-geohash/blob/master/geohash.py)License------MIT
Package: django-geographical-module
Add “geographical_module” to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
    ...
    'geographical_module',
]Runpython manage.py migrateto create the models.Runpython manage.py load_geo_recordsto populate the database with the initial records.Runpython manage.py load_nuts_postcode_recordsto populate the database with the NUTS-postcode relationship.
Package: django-geohash-cluster
High efficient clustering algorithm based on geohash of pointsDocumentationThe full documentation is athttps://django-geohash-cluster.readthedocs.io.QuickstartInstall django geohash cluster:pip install django-geohash-clusterAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'geohash_cluster',...)To use with :Django Rest Framework:http://www.django-rest-framework.org/$pipinstallgeohash_cluster[rest]INSTALLED_APPS=(...'rest_framework','rest_framework_gis',...'geohash_cluster',...)FeaturesAPointedmodel withPointField.Running TestsInstall dependencies:$pipenvinstall--dev$pipinstall.[rest]Does the code actually work?$source<YOURVIRTUALENV>/bin/activate(myenv)$pipinstalltox(myenv)$toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2017-07-25)First release on PyPI.
Package: django-geohashing
# django-geohashingA Django application for calculating geohashes and exposing themvia RESTful interface. Requires Django 1.8.x+ (takes advantage ofupdated argument parsing for custom management commands, see:[Django 1.8 Release Notes][1] for more information).## InstallationInstall with pip:```bashpip install django-geohashing```## Quick Start1. Add "geohashing"  and "rest_framework" to your INSTALLED_APPS:```pythonINSTALLED_APPS = (...'geohashing','rest_framework',)```2. Create the geohashing tables by resyncing your models:```bashpython manage.py migrate```3. Populate the table using the `get_historical_djia` management command:```bashpython manage.py get_historical_djia --start <date> --end <date>```The `get_historical_djia` command takes two optional parameters:`--start` and `--end`. These parameters accept date strings of the format`YYYY-MM-DD`. They may be used to limit the set of results fromwhich to database is populated (so for instance to only retrieve and processonly the 30 most recent DJIA openings instead of every opening since 1928).The parameters are optional but their use is very much encouraged; otherwisetens of thousands of records will be retrieved and imported individually.4. To expose the geohashing offsets via REST API, include `geohashing.urls` inyour `urls.py`. Though not strictly required, as a best practice a namespacefor the urls should be provided:```pythonfrom django.conf.urls import urlurlpatterns = [url(r'^geohashing/', include('geohashing.urls', namespace='geohashing')),]```## TODOThis project is still in an extremely early alpha stage. Tasks that still needto be tackled:- Update the importer to:- Handle the creation of new Day objects and the update of existing Dayobjects seperately so that we can use `bulk_create` to improveperformance.- Extrapolate data points beyond the maximum date when enough informationis available to do so.- Add a `get_current_djia` management command to be used for retrievingtoday's opening value. Occasionally the various sources for the openingvalue are initially inconsistent with one another. The management commandshould handle this gracefully by waiting for consensus.- Add unit tests and docs- Run Flake8 against the codebase and fix any glaring PEP-8 violations- Set up Continuous Integration...integration[1]: https://docs.djangoproject.com/en/1.8/releases/1.8/#extending-management-command-arguments-through-command-option-list
Package: django-geoip
App to figure out where your visitors are from by their IP address.Detects country, region and city, querying the database with geodata.
Optional high-level API provides user location in request object.Requires Django 1.4+, supports python 2.6, 2.7, 3.4, 3.5.Docs:http://django-geoip.readthedocs.org/
Package: django-geoipdb-loader
Helps download and keep updated maxmind’s geoip db required fordjango GeoIPFor Django 2.2+ and python 3.6+. For older versions usepip install django-geoipdb-loader<1.0.Why and when to use?If you don’t mind installing and configuringofficial geoipupdateon your server
then I’d recommend to use it.
If you want a simple method to download db files via django command or schedule
updates using celery then this app is the way to go.InstallationUsing pip:pip install django-geoipdb-loaderAdd the app to INSTALLED_APPS and configure GEOIP_PATH:INSTALLED_APPS = [
    ...
    geoipdb_loader,
    ...
]

GEOIP_PATH = '/myproject/geoip'
MAXMIND_LICENSE_KEY = 'your license key'UsageRunmanage.py download_geoipdbto download geoip files.In order to automatically update the geoip files you can use provided celery task:CELERYBEAT_SCHEDULE = {
    'update-geoipdb': {
        'task': 'geoipdb_loader.tasks.update_geoipdb',
        'schedule': crontab(day_of_week=6),
    },
}or crontab:* * * * 6 manage.py download_geoipdb
Package: django_geoip_redirection
[![Build Status](https://travis-ci.org/vinitkumar/django-geoip-redirection.svg?branch=master)](https://travis-ci.org/vinitkumar/django-geoip-redirection)Django-geoip-redirection========================![World Map](https://i.cloudup.com/7rf2v_IDxv-2000x2000.png)GeoIP based redirection is awesome and achieving it isn't too hard either. I wrote this middlewareto ensure that my website would get redirected properly with regards to the location of the useraccessing the website.## Usage:Add the middleware in your settings file:```pythonMIDDLEWARE_CLASSES = ('django.contrib.sessions.middleware.SessionMiddleware','django.middleware.csrf.CsrfViewMiddleware','django.contrib.auth.middleware.AuthenticationMiddleware','django.contrib.messages.middleware.MessageMiddleware','cms.middleware.language.LanguageCookieMiddleware','django_geoip_redirection.middleware.LocationMiddleWare',)```Also add `django_geoip_redirection` to INSTALLED APPS:```pythonINSTALLED_APPS = ('django_geoip_redirection',....)```## Customization:```python# Change the array for extension as per country you# have to supportif request.path[:4] in ["/en/", "/nl/", "/in/"]:return Noneif 'HTTP_X_FORWARDED_FOR' in request.META:request.META['REMOTE_ADDR'] = request.META['HTTP_X_FORWARDED_FOR']ip_address = request.META['REMOTE_ADDR']# get country name using Maxmind database.# Now, just match and redirect.# Likewise, replace the name of country to match and redirect.country = get_country_request(ip_address)if country == "India":return HttpResponseRedirect('/in/')elif country == "Netherlands":return HttpResponseRedirect('/nl/')else:return HttpResponseRedirect('/en/')return None```You would also need to place the `GeoIP.dat.dat` present inside the data folder toyour project root directory.
Package: django-geoip-redis
Django-GeoIP-Redis==================.. image:: https://api.travis-ci.org/gotlium/django-geoip-redis.png?branch=master:alt: Build Status:target: https://travis-ci.org/gotlium/django-geoip-redis.. image:: https://coveralls.io/repos/gotlium/django-geoip-redis/badge.png?branch=master:target: https://coveralls.io/r/gotlium/django-geoip-redis?branch=master.. image:: https://pypip.in/v/django-geoip-redis/badge.png:alt: Current version on PyPi:target: https://crate.io/packages/django-geoip-redis/.. image:: https://pypip.in/d/django-geoip-redis/badge.png:alt: Downloads from PyPi:target: https://crate.io/packages/django-geoip-redis/Documentation available at `Read the Docs <http://django-geoip-redis.readthedocs.org/>`_.Demo installation:------------------.. code-block:: bash$ sudo apt-get install redis-server virtualenvwrapper$ mkvirtualenv django-geoip-redis$ git clone https://github.com/gotlium/django-geoip-redis.git$ cd django-geoip-redis$ pip install -r requirements/package.txt$ python setup.py develop$ cd demo$ pip install -r requirements.txt$ python manage.py syncdb --noinput$ python manage.py migrate$ python manage.py loaddata ../fixtures/db.json$ python manage.py shell.. code-block:: python>>> from geoip.geo import record_by_ip_as_dict>>> print (record_by_ip_as_dict('91.195.136.52'))If you want use native db for local development,you can add ``GEO_BACKEND = 'db'`` into local_settings.pyPerformance:-----------* django-geoip-redis:- MySQL(SSD): 728 rps- SQLite(SSD): 46 rps- Redis: **3548 rps*** django-geoip(no isp, no provider):- MySQL(SSD): 855 rps- SQLite(SSD): 47 rps* django.contrib.gis.geoip.GeoIP(no isp, no provider, but C API):- standard: 4666 rps- memory: 73 rps- check: 4510 rps- index: 76 rps- mmap: 4425 rpsTested on Ubuntu 12.04(x86_64), Django(1.6), uWSGI(1.0.3), Nginx(1.1.19) with Apache Benchmark:.. code-block:: bash$ ab -c 100 -n 1000 http://localhost/ip/91.195.136.52/| On tests used default configuration for Redis & MySQL without any modifications.|| Demo page available `here <http://geoip-gotlium.rhcloud.com/ip/91.195.136.52/>`_.Compatibility:-------------* Python: 2.6, 2.7, 3.3* Django: 1.3.x, 1.4.x, 1.5.x, 1.6.. image:: https://d2weczhvl823v0.cloudfront.net/gotlium/django-geoip-redis/trend.png:alt: Bitdeli badge:target: https://bitdeli.com/free
Package: django-geoip-utils
Installationpip install django-geoip-utilsIn your settings write:import geoip_utils
GEOIP_PATH = geoip_utils.where()This product includes GeoLite data created by MaxMind, available fromhttp://maxmind.com/SettingsGEOIP_REQUEST_IP_RESOLVERDefault:'geoip_utils.core.remote_addr_ip'The function used for getting the IP of the client from the request.Options:'geoip_utils.utils.remote_addr_ip'Uses the REMOTE_ADDR of the request. Good for development and standard setup'geoip_utils.utils.x_forwarded_ip'Picks the first IP of theHTTP_X_FORWARDED_FORrequest header.
This is useful for Load balancers, but could be spoofed in some cases.
Amazon ELB sets this reliably though.'geoip_utils.utils.real_ip'Uses the HTTP_X_REAL_IP attributeGEOIP_CACHE_METHODDefault:django.contrib.gis.geoip.GeoIP.GEOIP_STANDARDThe caching function used for retrieving the location.Options:django.contrib.gis.geoip.GeoIP.GEOIP_STANDARDRead database from filesystem, uses least memorydjango.contrib.gis.geoip.GeoIP.GEOIP_MEMORY_CACHELoad database into memory, faster performance but uses more memorydjango.contrib.gis.geoip.GeoIP.GEOIP_CHECK_CACHEcheck for updated database.  If database has been updated, reload
filehandle and/or memory cache. This option is not thread safe but
is good for development.django.contrib.gis.geoip.GeoIP.GEOIP_INDEX_CACHEJust cache the most frequently accessed index portion of the database,
resulting in faster lookups thanGEOIP_STANDARD, but less memory
usage thanGEOIP_MEMORY_CACHE- useful for larger databases such as
GeoIP Organization and GeoIP City. Note, for GeoIP Country, Region and
Netspeed databases,GEOIP_INDEX_CACHEis equivalent toGEOIP_MEMORY_CACHE.django.contrib.gis.geoip.GeoIP.GEOIP_MMAP_CACHELoads database into mmap shared memory (not available on Windows).UtilitiesThere are a few server utility functions to make the handling easier:from geoip_utils import core as geoip

geoip.get_country(request)

geoip.get_city(request)

geoip.get_lat_lon(request)

geoip.get_country_code(request)

geoip.get_country_name(request)Template filtersThere are filters for extracting the information you need in the templates.
You need to havedjango.core.context_processors.requestenabled in your
TEMPLATE_CONTEXT_PROCESSORS:{% load geoip_tags %}

{{ request|country_code_of_request }}
{{ request|city_name_of_request }}
{{ request|postal_code_of_request }}
{{ request|region_of_request }}
{{ request|dma_code_of_request }}
{{ request|area_code_of_request }}
{{ request|lat_of_request }}
{{ request|lon_of_request }}Management commandYou can run theupdate_geoip_datamanagement command to download updated
GeoIP data in place.
Package: django-geojson-serializer
DRF geojson serializer is a decorator which allows to format data as geojsonhttp://geojson.orgQuick startGeojson serializer works with django rest framework as a decorator.Add django-geojson_serializer to your INSTALLED_APPS setting like this:INSTALLED_APPS = [
....
'geojson_serializer'
]In your code you can usegeojson_serializer(<name-of-geo-field>)decorator with a regualar serializer, e.g.:from geojson_serializer.serializers import geojson_serializer


class City(models.Model):
    name = models.CharField(max_length=128)
    location = models.PointField()


@geojson_serializer('location')
class CitySerializer(serializers.ModelSerializer):
    class Meta:
        model = City
        fields =['name', 'location']


class CityViewSet(viewsets.ModelViewSet):
    queryset = City.objects.all()
    serializer_class = CitySerializerThen you can register CityViewSet with a router and the view will generate and accept geojsons in corresponding requests.Also supported areidandbboxfields:@geojson_serializer('location', id='id', bbox='bounding_box')
class MySerializer(serializers.ModelSerializer):
....In this case'id'and'bounding_box'fields should be defined by the underlying serializerMySerializer.