Hi to all ,
finally I managed to install all libraries for this github project and when I type
I get all command options
...but I still have to configure postgresql database. All I have done is installing postgre sql ver 10 on my system.
Tom Slee in his help file says:
python airbnb.py -dbp
I get this:
p.s. here is my airbnb config file if someone wants to check it:
https://drive.google.com/open?id=1_psMrQ...r8_kAvobyh
In particular, in the gitub folder there is a postgresql folder.
Do I have to copy these files in my postgresql installation? and if so, where?
And where do I have to run this code?:
finally I managed to install all libraries for this github project and when I type
airbnb
I get all command options
usage: airbnb.py [options]
Manage a database of Airbnb listings.
optional arguments:
-h, --help show this help message and exit
-v, --verbose write verbose (debug) output to the log file
-c config_file, --config_file config_file
explicitly set configuration file, instead of using
the default <username>.config
-asa search_area, --addsearcharea search_area
add a search area to the database. A search area is
typically a city, but may be a bigger region.
-asv search_area, --add_survey search_area
add a survey entry to the database, for search_area
-dbp, --dbping Test the database connection
-dh host_id, --displayhost host_id
display web page for host_id in browser
-dr room_id, --displayroom room_id
display web page for room_id in browser
-dsv survey_id, --delete_survey survey_id
delete a survey from the database, with its listings
-f [survey_id], --fill [survey_id]
fill details for rooms collected with -s
-lsa search_area, --listsearcharea search_area
list information about this search area from the
database
-lr room_id, --listroom room_id
list information about room_id from the database
-ls, --listsurveys list the surveys in the database
-psa search_area, --printsearcharea search_area
print the name and neighborhoods for search area
(city) from the Airbnb web site
-pr room_id, --printroom room_id
print room_id information from the Airbnb web site
-ps survey_id, --printsearch survey_id
print first page of search information for survey from
the Airbnb web site
-psn survey_id, --printsearch_by_neighborhood survey_id
print first page of search information for survey from
the Airbnb web site, by neighborhood
-psz survey_id, --printsearch_by_zipcode survey_id
print first page of search information for survey from
the Airbnb web site, by zipcode
-psb survey_id, --printsearch_by_bounding_box survey_id
print first page of search information for survey from
the Airbnb web site, by bounding_box
-s survey_id, --search survey_id
search for rooms using survey survey_id
-sn survey_id, --search_by_neighborhood survey_id
search for rooms using survey survey_id
-sb survey_id, --search_by_bounding_box survey_id
search for rooms using survey survey_id, by bounding
box
-asb search_area, --add_and_search_by_bounding_box search_area
add a survey for search_area and search , by bounding
box
-sz survey_id, --search_by_zipcode survey_id
search for rooms using survey_id, by zipcode
-V, --version show program's version number and exit
-?
...but I still have to configure postgresql database. All I have done is installing postgre sql ver 10 on my system.
Tom Slee in his help file says:
Quote:Installing and upgrading the database schemaI'm not able to find the schema_current.sql file and of course when I check the database connection with:
The airbnb.py script works with a PostgreSQL database. You need to have the PostGIS extension installed. The schema is in
the file postgresql/schema_current.sql. You need to run that file to create the database tables to start with (assuming
both your user and database are named airbnb).
For example, if you use psql:
psql --user airbnb airbnb < postgresql/schema_current.sql
Preparing to run a survey
To check that you can connect to the database, run
python airbnb.py -dbp
python airbnb.py -dbp
I get this:
Error:ERROR Connection test failed
Traceback (most recent call last):
File "C:\python_37\airbnb\airbnb_config.py", line 186, in connect
self.connection = psycopg2.connect(**cattr)
File "C:\python_37\lib\site-packages\psycopg2\__init__.py", line 130, in conne
ct
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: fe_sendauth: no password supplied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "airbnb.py", line 142, in db_ping
conn = config.connect()
File "C:\python_37\airbnb\airbnb_config.py", line 190, in connect
logger.error(pgoe.message)
AttributeError: 'OperationalError' object has no attribute 'message'
Could someone help me in configuring psql database? p.s. here is my airbnb config file if someone wants to check it:
https://drive.google.com/open?id=1_psMrQ...r8_kAvobyh
Quote:Could someone help me in configuring psql database?
In particular, in the gitub folder there is a postgresql folder.
Do I have to copy these files in my postgresql installation? and if so, where?
And where do I have to run this code?:
psql --user airbnb airbnb < postgresql/schema_current.sql