Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/teitei-tk/sixisles
PyMongo Based ActiveRecord Pattern O/R Mapper
https://github.com/teitei-tk/sixisles
activerecord-pattern mongodb mongodb-orm python
Last synced: 26 days ago
JSON representation
PyMongo Based ActiveRecord Pattern O/R Mapper
- Host: GitHub
- URL: https://github.com/teitei-tk/sixisles
- Owner: teitei-tk
- License: mit
- Created: 2015-11-27T11:52:12.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-26T19:55:20.000Z (about 2 years ago)
- Last Synced: 2024-11-29T12:39:39.852Z (about 1 month ago)
- Topics: activerecord-pattern, mongodb, mongodb-orm, python
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SixIsles
PyMongo Based ActiveRecord Pattern O/R Mapper---
## Dependencies
* Python2.6 or Later
* PyMongo >= 3.1.1## Installation
```bash
$ pip install SixIsles
```## Example
Add Github Repository Documents```python
from sixIsles import Structure, Document, get_client
from sixIsles.types import ObjectId, Stringclass Repository(Document):
struct = Structure(
_id = ObjectId(),
name = String(),
author = String(),
url = String()
)class Meta:
database = get_client("test_db_name", "localhost")document = Repository()
document.name = "SixIsles"
document.author = "teitei-tk"
document.url = "https://github.com/teitei-tk/SixIsles"
document.insert()or
document = Repository({
"name": "SixIsles",
"author": "teitei-tk",
"url": "https://github.com/teitei-tk/SixIsles"
})
document.insert()
``````bash
$ mongo
.....
.....
> use test_db_name
switched to db test_db_name
> show collections;
repository
system.indexes
> db.repository.find()
{ "_id" : ObjectId("565895aacc7474890284fc8d"), "url" : "https://github.com/teitei-tk/SixIsles", "name" : "SixIsles", "author" : "teitei-tk" }
>
```## TODO
- [ ] Add TestCode and Api Document
- [ ] Update README
- [ ] Register CI Tools## License
* MIT