A db seeder etl tool for crash data.
- git clone this repo
- cd into folder and run
./setup.py install
- Get the csv's to use.
- Create a
.sde
connection to the database you want to seed. Place them incrashdb/connections
- Fill out
secrets.py
. Use thesecrets.sample.py
as an example. - run
python -m crashdb create <configuration>
where<configuration>
isdev, stage, prod
to create the database - run
python -m crashdb seed <source> <configuration>
where<source>
is the path to the csv'spath/to/csv's
and<configuration>
isdev, stage, prod
. In dev, this iscrashdb\data\csv
tox
expecting string data
means the lookup value was not in the models table. Change batch size to 2 and look for a number where there should be a value. Add the number: None
string or binary data to be truncated
- run python -m crashdb path/to/csv's --length
and adjust sql schema
ImportError: No module named x
. This means that x is not installed. Install the windows 64 bit python 2.7 module. If it is installed and you are in the tox environment you need to allow global site packages. For example update C:\Users\agrc-arcgis\Envs\crash\Lib\no-global-site-packags.txt
to allow-global-site-packages.txt
.
_csv.Error: line contains NULL byte
. CSV's need to be resaved.
The points.json are out of sync with the map service. The etl will create new points.json. The Crash-web has a python script that get's run on deploys to sync also. If these do not work, check the rest queries. If they are returning ESRI_OID
instead of OBJECTED
then the map service query layer needs to be updated. Only check the OBJECTID
field as unique. Remove all other checks and republish.
- checkout repo
- create
secrets.py
- make sure
pip
is installed - create
connections
folder withinsrc\crashdb
- run
pip install ./
from the current working directory containingsetup.py
- put connections and data folder inside
python\Lib\site-packages\crash_crashdb.egg\crashdb
if it's not already there
- With SQL Server Management Studio, create a
DDACTSadmin
andDDACTSread
user. MakeDDACTSadmin
a data owner and owner of theDDACTSadmin
schema. - Create an database connection in Pro to the database named
dev.sde
, using theDDACTSadmin
user and put it insrc/crashdb/connections
. - Run:
dbseeder create dev --testing