fiona-settings-0.1.0
توضیحات
Wrappers for fiona settings.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | fiona-settings-0.1.0 |
| نام | fiona-settings |
| نسخه کتابخانه | 0.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Tom Caruso |
| ایمیل نویسنده | carusot42@gmail.com |
| آدرس صفحه اصلی | https://github.com/tomplex/fiona_settings |
| آدرس اینترنتی | https://pypi.org/project/fiona-settings/ |
| مجوز | MIT |
## fiona-settings
Lightweight wrapper for `fiona` settings & schemas to make it a little easier to manipulate.
Fiona includes a lot of "magic strings" representings GDAL drivers, CRS values, data types, and more.
While it's all quite intuitive and relatively simple, I have always wished there
was a neater way to manage them all, and so I wrote this.
## install
Requires Python3.6+.
with pip:
```bash
pip install fiona-settings
```
from source:
```bash
git clone git@github.com:tomplex/fiona_settings.git
pip install fiona_settings/
```
## examples
```python
import fiona
from fiona_settings import Settings, Type, Driver, CRS
src = fiona.open('my_file.shp')
# from_collection copies the following settings from an already opened collection:
# - driver
# - schema
# - crs
# - encoding
settings = Settings.from_collection(src)
# add a string column with width 25
settings += ('my_column', Type.str(width=25))
settings += ('my_other_column', 'float') # don't need to use Enum types
# Remove a column by name
settings -= 'column_i_dont_want'
# unpack the settings directly into the fiona.open() function
sink = fiona.open('my_output_file.shp', 'w', **settings)
# Override any option which would be copied with a kwarg. Either
# string or enum values will work.
new_settings = Settings.from_collection(src, driver=Driver.GeoJSON)
sink = fiona.open('my_file.geojson', 'w', **new_settings)
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6.0 | Python |
نحوه نصب
نصب پکیج whl fiona-settings-0.1.0:
pip install fiona-settings-0.1.0.whl
نصب پکیج tar.gz fiona-settings-0.1.0:
pip install fiona-settings-0.1.0.tar.gz