Skip to content

Commit

Permalink
Merge pull request #84 from fabianazioti/b-1.0-alpha
Browse files Browse the repository at this point in the history
improve command line interface
  • Loading branch information
fabianazioti authored Feb 4, 2025
2 parents 172ef01 + 7d19f6b commit 64d4562
Show file tree
Hide file tree
Showing 19 changed files with 571 additions and 436 deletions.
2 changes: 1 addition & 1 deletion examples/describe_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from wlts import WLTS

# Specify the URL of the WLTS instance to be used
service = WLTS('https://brazildatacube.dpi.inpe.br/wlts/')
service = WLTS('https://data.inpe.br/bdc/wlts/v1')

# Get collection metadata
print(service['prodes_amazonia_legal'])
2 changes: 1 addition & 1 deletion examples/list_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

# You should create a wlts object attached to a given service
# Specify the URL of the WLTS instance to be used
service = WLTS('https://brazildatacube.dpi.inpe.br/wlts/')
service = WLTS('https://data.inpe.br/bdc/wlts/v1/')

# Returns the list of collections available on the service
print(service.collections)
2 changes: 1 addition & 1 deletion examples/text-repr.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from wlts import *

service = WLTS('https://brazildatacube.dpi.inpe.br/wlts/')
service = WLTS('https://data.inpe.br/bdc/wlts/v1/')

print(service)
print(str(service))
Expand Down
3 changes: 2 additions & 1 deletion examples/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from wlts import WLTS

# Specify the URL of the WLTS instance to be used
service = WLTS(url='https://brazildatacube.dpi.inpe.br/wlts/', access_token='change-me')
service = WLTS(url='https://data.inpe.br/bdc/wlts/v1/')

# Example of trajectory operation
# Make sure the collection is available in service
Expand All @@ -31,6 +31,7 @@
collections='prodes_amazonia_legal,mapbiomas-v8',
start_date='2010'
)
print (tj_m)
for tj in tj_m['trajectories']:
print(tj.trajectory)

Expand Down
74 changes: 74 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[project]
name = "wlts"
description = "."
readme = "README.rst"
requires-python = ">=3.8"
license = {file = "LICENSE"}
authors = [
{name = "Brazil Data Cube Team", email = "[email protected]"},
]
keywords = [
"lulc"
]
classifiers = [
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License version 3 License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
]
version="1.2.0"
dependencies = [
"Click>=7.0",
"Jinja2>=2.11.1",
"descartes>=1.1.0",
"shapely>=1.7.1",
"pandas>=1.1",
"geopandas>=0.8.2",
"plotly==5.5.0",
"rich>=13.9.2",
"lccs @ git+https://github.com/brazil-data-cube/[email protected]",
"rich>=10.0.0",
"httpx>=0.19.0",
]

# Extras Dependencies
[project.optional-dependencies]
dev = ["pre-commit"]
docs = [
"Sphinx>=7.0",
"sphinx_rtd_theme",
"sphinx-copybutton",
"sphinx-tabs",
]
tests = [
"coverage>=6.4",
"coveralls>=3.3",
"pytest>=7.4",
"pytest-cov>=4.1",
"pytest-pep8>=1.0",
"pydocstyle>=4.0",
"isort>4.3",
"check-manifest>=0.40",
]
all = ["wlts[docs,tests]"]
## End extras dependencies

[build-system]
requires = ["setuptools>=67.0", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["wlts*"]
exclude = ["tests*"]
namespaces = false

[tool.setuptools.package-data]
"wlts" = ["py.typed"]

[project.scripts]
wlts-cli = "wlts.cli:cli"
2 changes: 1 addition & 1 deletion run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@
pydocstyle wlts examples tests setup.py && \
isort wlts examples tests setup.py --check-only --diff && \
check-manifest --ignore ".drone.yml,.readthedocs.yml" && \
sphinx-build -qnW --color -b doctest docs/sphinx/ docs/sphinx/_build/doctest && \
sphinx-build -qn --color -b doctest docs/sphinx/ docs/sphinx/_build/doctest && \
pytest
95 changes: 2 additions & 93 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,97 +18,6 @@

"""Python Client Library for the Web Land Trajectory Service."""

import os
from setuptools import setup

from setuptools import find_packages, setup

readme = open('README.rst').read()

history = open('CHANGES.rst').read()

docs_require = [
'Sphinx>=2.2',
'sphinx_rtd_theme',
'sphinx-copybutton',
]

tests_require = [
'coverage>=4.5',
'pytest>=5.2',
'pytest-cov>=2.8',
'requests-mock[fixture]',
'pytest-pep8>=1.0',
'pydocstyle>=4.0',
'isort>4.3',
'check-manifest>=0.40',
'requests-mock>=1.7.0'
]

extras_require = {
'docs': docs_require,
'tests': tests_require,
}

extras_require['all'] = [ req for exts, reqs in extras_require.items() for req in reqs ]

setup_requires = [
'pytest-runner>=5.2',
]

install_requires = [
'requests>=2.20',
'Click>=7.0',
'Jinja2>=2.11.1',
'descartes>=1.1.0',
'shapely>=1.7.1',
'pandas>=1.1',
'geopandas>=0.8.2',
'plotly==5.5.0',
'lccs @ git+https://github.com/brazil-data-cube/[email protected]',
]

packages = find_packages()

with open(os.path.join('wlts', 'version.py'), 'rt') as fp:
g = {}
exec(fp.read(), g)
version = g['__version__']

setup(
name='wlts',
version=version,
description=__doc__,
long_description=readme + '\n\n' + history,
keywords=['Land Use Land Cover', 'GIS', 'Web Services', 'OGC WFS', 'OGC WCS', 'Web Time Series Service'],
license='GPLv3',
author='Brazil Data Cube Team',
author_email='[email protected]',
url='https://github.com/brazil-data-cube/wlts.py',
packages=packages,
zip_safe=False,
include_package_data=True,
platforms='any',
entry_points={
'console_scripts': [
'wlts-cli = wlts.cli:cli',
],
},
extras_require=extras_require,
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_require,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Scientific/Engineering :: GIS',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)
setup()
2 changes: 1 addition & 1 deletion tests/test_trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def test_trajectory(self, wlts_objects, requests_mock, runner, config_obj):
], obj=config_obj)

assert result.exit_code == 0
assert 'trajectory:' in result.output
assert 'Processing trajectory request...' in result.output


if __name__ == '__main__':
Expand Down
Loading

0 comments on commit 64d4562

Please sign in to comment.