semvec/pypi-packages huggingface dataset:
fab-geoalchemy 0.1.6
Plugin to implement Geoalchemy fields in Flask Appbuilder
Keywords: gis sqlalchemy

THIS PACKAGE HAS BEEN DEPRECATED.
=================================

In order to use the proper flask appbuilder addon infrastructure, this package has been deprecated in favor of flask-addon-geoalchemy. This package won't be updated.

fab_geoalchemy
==============

Implementation of GeoAlchemy fields for Flask Appbuilder.

It automatically transforms POINT Geometry columns to widgets with a field for latitude and longitude.
The goal is to add a leaflet widget and add support for line and polygon as well.

Installation
------------

Run ``pip install fab-geoalchemy``.

Usage
-----

You can find examples in the unittests in the tests folder.
But in short, this is what you need to do:

.. code-block::

   from fab_geoalchemy.views import GeoModelView
   from fab_geoalchemy.interface import GeoSQLAInterface

   class Observation(Model):
       id = Column(Integer, primary_key=True)
       name = Column(String)
       location = Column(Geometry(geometry_type='POINT', srid=4326))

       def __repr__(self):
           if self.name:
               return self.name
           else:
               return 'Person Type %s' % self.id


   class ObservationView(GeoModelView):
       datamodel = GeoSQLAInterface(Observation)
       add_columns = ['name', 'location']

This will automatically create the LatLonWidget in the form, and process the data to transform the latitude and longitude values into a point geometry in the database. The srid form the column is used by the field for the conversion of the text coordinates to the geometry. No validation is done if the entered coordinates are actually valid for the specified SRID.
pakk-flask 2.0.0
Utilities for working with pakk files in a flask web application.

# pakk flask

Utilities for working with pakk files in a flask web application.

## Getting Started

Install pakk and pakk_flask:

```sh
$ python3 -m pip install pakk pakk_flask
```

Then you can use pakk_flask to send pakked assets as static files in a flask web application:

```py
from pakk_flask import send_from_directory

@APP.route("/static/<path:path>")
def get_static_file(path):
    with open("./files.pakk", "rb") as in_file:
        unpakked = unpakk(KEY, in_file)
        if unpakked.has_blob(path):
            return send_from_directory(unpakked, path)
        else:
            return send_from_directory("./static", path)
```

You can also use pakk_flask to render templates from pakk files:

```py
from pakk_flask import render_template, PakkTemplate

@APP.route("/home")
def get_home_page():
    with open("./files.pakk", "rb") as in_file:
        unpakked = unpakk(KEY, in_file)
        render_template(PakkTemplate(unpakked, "index.html"),
            some_value="Hello, ",
            another_value="World!")
```
django-xlspopulator 1.1
Populate your Django model from .xls file

# django_xlspopulator
Easy to use .xls Django model populator. 


How to:
1. First you need to install latest version of <b>xlrd: pip install xlrd==1.1.0</b>
1. In order for this to work, you need exactly match your model's field names and xls's first row values(column names), like this:
    ```python
    class Test(models.Model):
      one = models.CharField(max_length=150)
      two = models.CharField(max_length=150)
      three = models.CharField(max_length=150)
      four = models.CharField(max_length=150)
    ```
    <img src="https://github.com/bloodwithmilk25/django-xlspopulator/blob/master/col_names.jpg">
1. Then you need to create `populate.py` file at the one level with your `manage.py`
1. Put following code there:
    ```python
    # populate.py
    import os
    import django
    from django_xlspopulator.populator import Populator
    os.environ.setdefault('DJANGO_SETTINGS_MODULE','YOURPOJECT.settings')
    django.setup()
    from YOURAPP.models import Test

    pop = Populator('C:/Users/Guido/Desktop/testfile.xls', Test)
    pop.populate()
    ```
    * Populator object takes three arguments:
      * path to the .xls file in form of a string
      * Django model object
      * Sheet number, int(0 by defaulft, specify it if you want to use other sheet)
1. Run `populate.py` from the terminal and wait. For my old machine with SQLite it took 5 mins to populate model from file that had 4 columns and 10000 rows.
confi 0.0.4.1
Comfortable python app configuration
Keywords: configuration,env,docker

Comfortable python configs from environment variables.
* Validated at **import time**. If you forgot a configuration variable you find out at startup.
* One source of configuration for all application code. No more `flask_conf.cfg`, `myconfig.ini`, `.env`, hardcoded constants and variables from `docker-compose.yml`.
* Type casting and validation at load time. Do it once and forget.

# Quickstart
```
>>> from confy import BaseEnvironConfig
>>> class Config(BaseEnvironConfig):
...  DEBUG = ConfigField(processor=strtobool, default=True)
...
>>> Config.DEBUG
True
```

Loads variable `DEBUG` __at import time__ from environment, applies function `string_to_bool` to the value,

If variable is not provided uses the default of `True`.

# Config field options
* `default` - default value, can be anything
* `required` - boolean, default `False`. Throws `ConfigError` if value is required, but not provided.
* `processor` - callable. Can be used to validate the value
* `from_var` - specify environment variable to take value from. If none uses config class property name, __case is important__.

# Mocking in tests
Since its a global class that can't be instanced it's __very important__ to import it like this:

```
from package import module
print(module.ConfigClass.as_text())
```

and __not__ like this:

```
from package.module import ConfigClass
print(ConfigClass.as_text())
```

The first option allows you to monkey patch the config during testing.
Pytest example:

```
from package.module import ConfigClass

class TestConfig(ConfigClass):
    pass

TestConfig.TEST = True

monkeypatch.setattr('package.module.ConfigClass', TestConfig)
```

All code accesing `module.ConfigClass` will get `TestConfig`.