Skip to main content

Fixture generator for fixture module

Project description

# Fixture Generator for [Fixture](https://github.com/fixture-py/fixture)

Supports only SQLAlchemy

## Install

Using pip

```sh
pip install fixturegen
```

Or using easy_install

```sh
easy_install fixturegen
```

## Usage

Basic

```sh
$ fixturegen mysql://user:password@localhost/your_db user
from fixture import DataSet

class UserData(DataSet):
class user_0:
id = 1
name = u'first'
class user_1:
id = 2
name = u'second'
class user_2:
id = 3
name = u'third'
```

Limiting

```sh
$ fixturegen mysql://user:password@localhost/your_db user --limit=2
from fixture import DataSet

class UserData(DataSet):
class user_0:
id = 1
name = u'first'
class user_1:
id = 2
name = u'second'
```

Ordering

```sh
$ fixturegen mysql://user:password@localhost/your_db user --order-by='id DESC'
from fixture import DataSet

class UserData(DataSet):
class user_0:
id = 3
name = u'third'
class user_1:
id = 2
name = u'second'
class user_2:
id = 1
name = u'first'
```

Filtering

```sh
$ fixturegen mysql://user:password@localhost/your_db user --where='id > 1'
from fixture import DataSet

class UserData(DataSet):
class user_0:
id = 2
name = u'second'
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fixturegen-0.3.tar.gz (2.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page