https://github.com/williamfzc/j2db
standard and safe way to upload your json to db
https://github.com/williamfzc/j2db
database http json sqlalchemy
Last synced: about 1 year ago
JSON representation
standard and safe way to upload your json to db
- Host: GitHub
- URL: https://github.com/williamfzc/j2db
- Owner: williamfzc
- License: mit
- Created: 2019-09-11T15:09:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-18T05:54:59.000Z (about 6 years ago)
- Last Synced: 2025-02-04T14:07:58.015Z (about 1 year ago)
- Topics: database, http, json, sqlalchemy
- Language: Python
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# j2db (JSON to Database)
[](https://badge.fury.io/py/j2db)

standard and safe way to upload your json to db
## flow

- http request with json data (from wherever you like)
- verify (format and content)
- customize your own flow (full support of hook!)
- upload to db
based on it, developers can easily build their own lightweight cross-platform center for data collection.

## why
Data uploader is a really important part in development workflow.
But many (so many) different db clients in different places or different languages make me feel tired, and i have to implement them in different projects again and again ...
Why do not we use JSON directly? and actually, some (most of) projects should not operate database directly.
## what's the difference with others
> **In production environment, you should consider ELK firstly.**
> ELK is nearly the best way to handle logging issues. It's standard and stable.
j2db offers a flexible and lightweight (ELK is good but huge) way to developers, which makes them upload the specific contents you care (e.g. CI status) to database, in different platforms or languages, more conveniently.
the point is:
- easy to use in different projects
- lightweight enough, less dependencies
- stable
- customizable
## support more actions? (query / delete / update)
Have no plan now. And, that is why this repo called `j2db`, not `db2j`.
- `query` should be better implemented by others, exposed via HTTP API or something else
- `update` and `delete` will modify the origin data. **BUT, LOG (OR SOMETHING LIKE THAT) SHOULD BE IMMUTABLE.**
## how
- server for receiving http request, and get JSON
- check (support custom hook)
- convert JSON to model (ORM built with SQLAlchemy)
- upload to db
## usage
see [example](example)
## dependencies
- [fastapi](https://github.com/tiangolo/fastapi): as web server
- [sqlalchemy](https://github.com/sqlalchemy/sqlalchemy): as db manager
## dev plan
see [project kanban](https://github.com/williamfzc/j2db/projects/1)
## bug report & suggestion & contribution
via [issue board](https://github.com/williamfzc/j2db/issues)
welcome to join this project :)
## license
[MIT](LICENSE)