Skip to content

Commit daf32ab

Browse files
author
Ivan Dlugos
committed
update and split out contribution section from readme to CONTRIBUTING.md
1 parent e4e15a5 commit daf32ab

File tree

2 files changed

+49
-39
lines changed

2 files changed

+49
-39
lines changed

CONTRIBUTING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Contributing
2+
------------------
3+
Anyone can contribute, be it by coding, improving docs or just proposing a new feature.
4+
As a new contributor, you may want to have a look at some of the following issues:
5+
* [**good first issue**](https://github.com/objectbox/objectbox-python/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) tag
6+
* [**help wanted**](https://github.com/objectbox/objectbox-python/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) tag
7+
8+
When picking up an existing issue, please let others know in the issue comment.
9+
Don't hesitate to reach out for guidance or to discuss a solution proposal!
10+
11+
### Code contributions
12+
When creating a Pull Request for code changes, please check that you cover the following:
13+
* Include tests for the changes you introduce. See the [tests folder](tests) for examples.
14+
* Formatted the code according to PEP-8
15+
16+
### Basic technical approach
17+
ObjectBox offers a [C API](https://github.com/objectbox/objectbox-c) which can be integrated into python using
18+
[ctypes](https://docs.python.org/dev/library/ctypes.html).
19+
The C API is is also used by the ObjectBox language bindings for [Go](https://github.com/objectbox/objectbox-go),
20+
[Swift](https://github.com/objectbox/objectbox-swift), and [Dart/Flutter](https://github.com/objectbox/objectbox-dart).
21+
These language bindings currently serve as an example for this Python implementation.
22+
Internally, ObjectBox uses [FlatBuffers](https://google.github.io/flatbuffers/) to store objects.
23+
24+
The main prerequisite to using the Python APIs is the ObjectBox binary library (.so, .dylib, .dll depending on your
25+
platform) which actually implements the database functionality. The library should be placed in the
26+
`objectbox/lib/[architecture]/` folder of the checked out repository. You can get/update it by running `make get-lib`.
27+
28+
### Getting started as a contributor
29+
#### Initial setup
30+
If you're just getting started, run the following simple steps to set up the repository on your machine
31+
* clone this repository
32+
* `pip install virtualenv` install [virtualenv](https://pypi.org/project/virtualenv/) if you don't have it yet
33+
* `make init` initialize the virtualenv
34+
* `make get-lib` get the objectbox-c shared library for your platform; also run this to update to a newer version
35+
36+
#### Regular development workflow
37+
You'll probably use the following commands regularly when implementing a new feature in the library:
38+
* `make test` to make sure everything works as expected after your changes
39+
* `make benchmark` to measure the CRUD performance on your machine - if you're working on a performance-related change

README.md

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ ObjectBox Python API
22
====================
33
ObjectBox is a superfast database for objects, now also available for Python with a simple CRUD API.
44

5-
* Latest release: v0.1.0
65
* Python version: 3.4+
76
* Platforms supported:
87
* Linux 64-bit
@@ -70,6 +69,7 @@ For more information and code examples, see the tests folder. The docs for other
7069
* ObjectBox Java = https://docs.objectbox.io
7170
* ObjectBox Go - https://golang.objectbox.io
7271
* ObjectBox Swift - https://swift.objectbox.io
72+
* ObjectBox Dart/Flutter - https://github.com
7373

7474
Some features
7575
-------------
@@ -87,45 +87,16 @@ The goodness you know from the other ObjectBox language-bindings, e.g.,
8787
* asynchronous operations
8888
* secondary indexes
8989

90-
PS.: contributions are very welcome! :)
90+
Help wanted
91+
-----------
92+
ObjectBox for Python is still in an early stage with limited feature set (compared to other languages).
93+
To bring all these features to Python, we're asking the community to help out. PRs are more than welcome!
94+
The ObjectBox team will try its best to guide you and answer questions. See [CONTRIBUTING.md](CONTRIBUTING.md) to get started
9195

92-
Contributing
93-
------------
94-
Currently, the Python binding is in its very early stages and lots of features available in other languages are missing.
95-
If you have a request for a specific feature, please open an issue. If you want to contribute, please feel free to open a PR.
96-
In case it's a non-obvious contribution it might be better to discuss and align first in an issue.
97-
98-
This repo uses `virtualenv` when installing packages so in case you don't have it yet: `pip install virtualenv`.
99-
100-
The main prerequisite to using the Python APIs is the ObjectBox binary library (.so, .dylib, .dll depending on your platform) which actually implements the database functionality.
101-
102-
The library should be placed in the `objectbox/lib/[architecture]/` folder of the checked out repository.
103-
104-
### Getting ObjectBox C-API library from pip
105-
The easiest way is to get all the binaries from the latest release in PyPI.
106-
107-
```bash
108-
pip download objectbox
109-
unzip objectbox*.whl
110-
cp -r objectbox/lib [/path/to/your/git/objectbox/checkout]/objectbox/
111-
```
112-
113-
### Downloading from the ObjectBox-C release
114-
Alternatively, you can get the appropriate release from the ObjectBox-C repository.
115-
However, you need to pay attention to the required version - see `required_version` in `objectbox/c.py`.
116-
In the [ObjectBox C repository](https://github.com/objectbox/objectbox-c), you should find a download.sh script you can run.
117-
118-
119-
```bash
120-
wget https://raw.githubusercontent.com/objectbox/objectbox-c/master/download.sh
121-
chmod +x download.sh
122-
# replace [required_version] with the appropriate string then type N when the script asks about installing the library
123-
./download.sh [required_version]
124-
cp lib/*objectbox* [/path/to/your/git/objectbox/checkout]/objectbox/lib/$(uname -m)/
125-
```
126-
127-
You can run `make test` to make sure everything works as expected.
128-
You can also try `make benchmark` to measure the CRUD performance on your machine.
96+
Feedback
97+
--------
98+
Also, please let us know your feedback by opening an issue: for example, if you experience errors or if you have ideas
99+
for how to improve the API. Thanks!
129100

130101
License
131102
-------

0 commit comments

Comments
 (0)