Comments (11)
I just added you as the owner of the package on PyPI. Check your email.
from open-buildings.
I am working on it now.
from open-buildings.
We can use click for the CLI. The commands need to be added cli.py
, which can call functions in open_buildings.py
https://click.palletsprojects.com/en/8.1.x/
https://github.com/opengeos/open-buildings/blob/main/open_buildings/cli.py
from open-buildings.
So I built up the click interface in the open_buildings.py, see
andSo do we just need to move the click definitions ones to the cli.py?
from open-buildings.
The 'usage' stuff in https://github.com/opengeos/open-buildings#functionality was generated by the CLI I had - and I managed to get it so I could use the CLI, but failed to get it so it would install right. Your new package definitely installs it right - just not sure how to hook it up.
from open-buildings.
Correct. Just move the cli interface from the main module to cli.py. It should work. The entry point is in setup.py
.
https://github.com/opengeos/open-buildings/blob/main/setup.py#L44
entry_points={
'console_scripts': [
'open_buildings=open_buildings.cli:main',
],
},
I think the problem with your previous repo was that the command in the entry_points has hyphens rather than undersores. Commands should have not hyphens.
https://github.com/cholmes/google-buildings-tools/blob/main/setup.py#L10
entry_points={
'console_scripts': [
'google-buildings-cli=google_buildings_cli:main',
],
},
from open-buildings.
Ok, I think I got it working, and bumped to a 0.0.4 release.
How do I push to pypi? I just signed up - https://pypi.org/user/cholmes/
from open-buildings.
It is automatically pushed to pypi once a release is created.
https://pypi.org/project/open-buildings/
from open-buildings.
It is automatically pushed to pypi once a release is created.
Oh cool! I tried once but failed to update the versions, then forgot to check on the one after I did it right. Thanks!
from open-buildings.
Ah darn, I thought I had the CLI working, as it was returning responses, but I think I didn't actually hook it up right:
Traceback (most recent call last):
File "/Users/cholmes/repos/venv/gob/bin/open_buildings", line 33, in <module>
sys.exit(load_entry_point('open-buildings==0.0.4', 'console_scripts', 'open_buildings')())
File "/Users/cholmes/repos/venv/gob/lib/python3.9/site-packages/click/core.py", line 1157, in __call__
return self.main(*args, **kwargs)
File "/Users/cholmes/repos/venv/gob/lib/python3.9/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/Users/cholmes/repos/venv/gob/lib/python3.9/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/cholmes/repos/venv/gob/lib/python3.9/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/cholmes/repos/venv/gob/lib/python3.9/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/Users/cholmes/repos/venv/gob/lib/python3.9/site-packages/open_buildings/cli.py", line 54, in benchmark
results = process_benchmark(
NameError: name 'process_benchmark' is not defined
How do I get two python files to work with one another? Like how do I properly call the definitions in https://github.com/opengeos/open-buildings/blob/main/open_buildings/open_buildings.py from the cli (https://github.com/opengeos/open-buildings/blob/main/open_buildings/cli.py) - I moved the definitions, but was hoping since they were in the same directory it'd work.
from open-buildings.
Ok, think I figured this out, just need the import statements. Going to close this in the hope that the CLI is truly working in 0.5. Would be great if someone could confirm that to be true...
from open-buildings.
Related Issues (20)
- Automatically calculate country codes per quadkey & remove country_iso flag HOT 2
- Option to just get the 'count' of buildings, but not actually download the results. HOT 2
- Better progress reporting in `get_buildings` HOT 1
- Make get building requests with smaller quadkeys
- Better estimates of how long a query might take
- Warn users if their geojson is not in `iso_country`
- Don't create empty files if there are 0 features
- Add tests HOT 2
- Create QGIS plugin for get_buildings HOT 2
- Install spatial extension if not installed HOT 3
- Add a geocoding option HOT 2
- Tidy up requirements.txt
- Structure of the package
- Python interface for functionality
- Cannot save as Shapefile HOT 10
- Allow both .geojson and .json as suffixes to mean output as GeoJSON
- Accept more input formats HOT 2
- Installation requirement files and dependencies HOT 3
- Nicer error reporting when geocoder fails HOT 6
- Document version of data used HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from open-buildings.