Skip to main content

A database-respecting object-relational mapper for PostgreSQL.

Project description

What Simpycity Is

Simpycity is an object-relational mapper. It seamlessly maps PostgreSQL query and function result sets to Python classes and class attributes.

It allows for the easy and rapid development of query- and stored procedure-based data representations. Simpycity leverages PostgreSQL’s powerful composite type system, and the advanced type handling of the psycopg2 database access library.

What Simpycity is Not

Simpycity is not a SQL generator and does not attempt to abstract or hide SQL. Simpycity is designed for developers who deeply understand SQL and desire to write the best possible SQL representations for their database. Simpycity also rejects the Active Record and Data Mapper paradigms, whose simplistic patterns fail in even moderately complex systems.

Core Philosophy

The core philosophy behind Simpycity is that the Database and the Application are separate entities, each with distinct abilities and design representations; this echoes the classic Object versus Relation argument. It provides a mechanism where a single business Object can easily represent several Relations, and allow the base Relational layer to follow normal forms without compromising or complicating application design.

Usage

At its simplest, object-relation mapping looks like:

--SQL
create table foo (id int, name text);
insert into foo (id, name) values (1, 'one'), (2, 'two');

#Python
class Foo(simpycity.model.SimpleModel):
    pg_type = ('public', 'foo')
    __load__ = simpycity.core.QuerySingle('foo',['id'])

my_foo = Foo(1)
print(my_foo.name)
>>>one

Read the tutorial for more narrative help.

License

Simpycity is licensed under the LGPL license, and a copy of your rights and permissions is available in the LICENSE file included in your distribution.

Contact

The official source repository is https://github.com/commandprompt/Simpycity

For support, questions, and additional help with Simpycity, please feel free to contact us on github.

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

Simpycity-2.0.1.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

Simpycity-2.0.1-py2.py3-none-any.whl (21.5 kB view details)

Uploaded Python 2Python 3

File details

Details for the file Simpycity-2.0.1.tar.gz.

File metadata

  • Download URL: Simpycity-2.0.1.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Simpycity-2.0.1.tar.gz
Algorithm Hash digest
SHA256 646ab8b8465d04866014c580f9dff3c46da175916fc94011efddb0904d2f8a6f
MD5 44e270701552db10888017e2c22ad348
BLAKE2b-256 38f0716827819be0fbf8f56212ea9669241ecba530709ec4dc69b16b249886c5

See more details on using hashes here.

File details

Details for the file Simpycity-2.0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for Simpycity-2.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c3e4a7f1981d7e9d151f5b19fe3f5f9b046b170d473bae032900f9443badf48f
MD5 f957567f536154326e88da5e7a2f0ce5
BLAKE2b-256 ebbea29aa9b7e4ed2122db0b195a73f5a6f9910f4363bbf84bb5abf6424d1053

See more details on using hashes here.

Supported by

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