datapusher | standalone web service that pushes data files | REST library
kandi X-RAY | datapusher Summary
kandi X-RAY | datapusher Summary
DataPusher is a standalone web service that automatically downloads any tabular data files like CSV or Excel from a CKAN site's resources when they are added to the CKAN site, parses them to pull out the actual data, then uses the DataStore API to push the data into the CKAN site's DataStore. This makes the data from the resource files available via CKAN's DataStore API. In particular, many of CKAN's data preview and visualization plugins will only work (or will work much better) with files whose contents are in the DataStore.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Push data to a datastore
- Check HTTP response status code
- Check if a datastore resource exists
- Chunk items into chunks
- Send data to Datastore
- Update a resource
- Delete a resource
- Get a CAN resource
- Validate input
- Get URL for ckan action
- Start the web server
datapusher Key Features
datapusher Examples and Code Snippets
# Install requirements for the DataPusher
sudo apt install python3-venv python3-dev build-essential
sudo apt-get install python-dev python-virtualenv build-essential libxslt1-dev libxml2-dev git libffi-dev
# Create a virtualenv for datapusher
s
sudo apt-get install python-dev python-virtualenv build-essential libxslt1-dev libxml2-dev zlib1g-dev git libffi-dev
git clone https://github.com/ckan/datapusher
cd datapusher
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip
ckan -c /etc/ckan/default/ckan.ini datapusher resubmit
paster --plugin=ckan datapusher resubmit -c /etc/ckan/default/ckan.ini
ckan -c /etc/ckan/default/ckan.ini datapusher submit {dataset_id}
paster --plugin=ckan datapusher submit -c /etc/ckan/de
Community Discussions
Trending Discussions on datapusher
QUESTION
My company is using a CKAN instance configured with Data Store and DataPusher. When a CSV file is uploaded to CKAN, DataPusher sends it to the DataStore and creates a default Data Dictionary for the resource. The Data Dictionary is a very nice feature to display the description of data fields for the users. Here is an example:
I can update the Data Dictionary using the UI, or it can be sent as part of the Fields passed to datastore_create()
.
My problem, is that I don't control the call of datastore_create()
because this method is automatically called buy the DataPusher service.
I want to programatically set the values of the Data Dictionary, but I can't find and api call that allow me to do it. An api call that update the Fields metadata. Can I do it using the Api? Or maybe it is possible create it when I create the data resource. I'd like a code example.
...ANSWER
Answered 2021-Mar-22 at 14:19You can use the API call datastore_create on top of an existing table. This will not impact the data in the table.
You should use the datastore_search to check the format of how the dictionary is saved in one of your resources (result->fields->info). Use that as your base, make the desired changes, and use it in the body of the datastore_create
call.
Unfortunately, the API call datastore_info
does not give you back that information.
The majority of the CKAN UI functionalities can be made through the API as well. In this case, you can make use of the "datastore_create" by the controller --> See Code here.
QUESTION
I have been trying for several days now to run CKAN as a docker image. The official CKAN documentation explains in detail how to create your own docker image via "docker-compose". The basic workflow is:
- Clone the CKAN source files from GitHub
- Make some changes in the "docker-compose.yml" file (custom passwords, extensions, etc)
- Run "docker-compose"
This gives you a running CKAN docker container together with all the necessary databases and search engines.
My ultimate goal however is to push this CKAN docker image to Docker-Hub and to run it on other machines via "docker run". I want to use this apporach because I want to extensively modify the original CKAN installation, and also add custom datasets, groups and organizations to the running catalog before pushing it to docker hub. "Docker run" seems to be much easier and more convenient compared to using "Docker compose".
The problem is: Whenever I try to run the CKAN container using the commands below I end up with the following error:
...ANSWER
Answered 2020-Oct-15 at 17:28run it as a docker compose command if you want to run it from docker you need to split away docker files and send some arguments from .env file like error says SQL_ALCHEMY is not being sent.
i would recommend to execute it as docker compose. then once you build from docker compose you can just execute docker run and send missing arguments like SQL_ALCHEMY.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install datapusher
The default DataPusher configuration uses SQLite as the backend for the jobs database and a single uWSGI thread. To increase performance and concurrency you can configure DataPusher in the following way:.
Use Postgres as database backend, which will allow concurrent writes (and provide a more reliable backend anyway). To use Postgres, create a user and a database and update the SQLALCHEMY_DATABASE_URI settting accordingly: # This assumes DataPusher is already installed sudo apt-get install postgresql libpq-dev sudo -u postgres createuser -S -D -R -P datapusher_jobs sudo -u postgres createdb -O datapusher_jobs datapusher_jobs -E utf-8 # Run this in the virtualenv where DataPusher is installed pip install psycopg2 # Edit SQLALCHEMY_DATABASE_URI in datapusher_settings.py accordingly # eg SQLALCHEMY_DATABASE_URI=postgresql://datapusher_jobs:YOURPASSWORD@localhost/datapusher_jobs
Start more uWSGI threads. On the deployment/datapusher-uwsgi.ini file, set workers and threads to a value that suits your needs, and add the lazy-apps=true setting to avoid concurrency issues with SQLAlchemy, eg: # ... rest of datapusher-uwsgi.ini workers = 3 threads = 3 lazy-apps = true
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page