From 565bf43ce6fe1ec7029c89eab6ba3a40bd97afff Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 15 May 2023 07:03:38 +0000 Subject: automatic import of python-falcano --- .gitignore | 1 + python-falcano.spec | 632 ++++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 634 insertions(+) create mode 100644 python-falcano.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..d8c9a24 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/falcano-0.0.10.tar.gz diff --git a/python-falcano.spec b/python-falcano.spec new file mode 100644 index 0000000..ca6c89d --- /dev/null +++ b/python-falcano.spec @@ -0,0 +1,632 @@ +%global _empty_manifest_terminate_build 0 +Name: python-falcano +Version: 0.0.10 +Release: 1 +Summary: Falcano +License: BSD License +URL: https://github.com/3mcloud/falcano +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/73/42/4944c45830ef41b24776040a839f0ad62183cf72c71f1448bf758d0d2138/falcano-0.0.10.tar.gz +BuildArch: noarch + +Requires: python3-stringcase +Requires: python3-rsa +Requires: python3-PyYAML +Requires: python3-pylint +Requires: python3-pytest +Requires: python3-pytest-cov +Requires: python3-bandit +Requires: python3-safety +Requires: python3-paste +Requires: python3-ptvsd +Requires: python3-boto3 + +%description +# Falcano + +A Pythonic interface for Amazon's DynamoDB that supports Python 3 and [single-table design](https://www.alexdebrie.com/posts/dynamodb-single-table/) based on [PynamoDB](https://github.com/pynamodb/PynamoDB). + +## Installation + +```bash +pip install falcano +``` + +## Basic Usage + +Basic usage is nearly identical to `PynamoDB`. `Meta` must inherit from `Model.Meta` and `Type` must be defined for every model. + +Create a model that describes a model in your table. + +```python +from falcano.model import Model +from falcano.attributes import UnicodeAttribute + +class User(Model): + ''' + A DynamoDB User + ''' + class Meta(Model.Meta): + table_name = 'dynamodb-user' + billing_mode = 'PAY_PER_REQUEST' + email = UnicodeAttribute(null=True) + first_name = UnicodeAttribute(range_key=True) + last_name = UnicodeAttribute(hash_key=True) + Type = UnicodeAttribute(default='user') +``` + +Create the table if needed: + +```python +User.create_table(billing_mode='PAY_PER_REQUEST') +``` + +Create a new user: + +```python +user = User('John', 'Denver') +user.email = 'djohn@company.org' +user.save() +``` + +Now, search your table for all users with a last name of 'Denver' and whose first name begins with 'J': + +```python +for user in User.query('Denver', User.first_name.startswith('J')): + print(user.first_name) +``` + +Examples of ways to query your table with filter conditions: + +```python +for user in User.query('Denver', User.email.eq('djohn@company.org')): + print(user.first_name) +for user in User.query('Denver', User.email=='djohn@company.org'): + print(user.first_name) +``` + +Retrieve an existing user: + +```python +try: + user = User.get('John', 'Denver') + print(user) +except User.DoesNotExist: + print('User does not exist') +``` + +## Advanced Usage + +Indexes? No problem: + +```python +from falcano.model import Model +from falcano.indexes import GlobalSecondaryIndex, AllProjection +from falcano.attributes import NumberAttribute, UnicodeAttribute + +class ViewIndex(GlobalSecondaryIndex): + class Meta: + billing_mode = 'PAY_PER_REQUEST' + projection = AllProjection() + view = NumberAttribute(default=0, hash_key=True) + +class TestModel(Model): + class Meta(Model.Meta): + table_name = 'TestModel' + forum = UnicodeAttribute(hash_key=True) + thread = UnicodeAttribute(range_key=True) + view = NumberAttribute(default=0) + Type = UnicodeAttribute(default='test') + view_index = ViewIndex() +``` + +Now query the index for all items with 0 views: + +```python +for item in TestModel.view_index.query(0): + print(f'Item queried from index: {item}') +``` + +It's simple! + +Want to use DynamoDB local? Add a `host` name attribute and specify your local server. + +```python +from falcano.models import Model +from falcano.attributes import UnicodeAttribute + +class User(Model): + ''' + A DynamoDB User + ''' + class Meta(Model.Meta): + table_name = 'dynamodb-user' + host = 'http://localhost:8000' + email = UnicodeAttribute(null=True) + first_name = UnicodeAttribute(range_key=True) + last_name = UnicodeAttribute(hash_key=True) + Type = UnicodeAttribute(default='user') +``` + +## Single-Table Design Usage + +Want to follow single-table design with an index and rename the `Type` attribute? No problem: + +```python +from falcano.model import Model +from falcano.indexes import GlobalSecondaryIndex, AllProjection +from falcano.attributes import NumberAttribute, UnicodeAttribute + +class TypeIndex(GlobalSecondaryIndex): + class Meta: + index_name = 'Type' + billing_mode = 'PAY_PER_REQUEST' + projection = AllProjection() + Kind = UnicodeAttribute(default=0, hash_key=True) + +class BaseModel(Model): + class Meta(Model.Meta): + table_name = 'single_table' + # use the Kind attribute in place of Type for deserialization + model_type = 'Kind' + PK = UnicodeAttribute(hash_key=True) + SK = UnicodeAttribute(range_key=True) + TypeIndex = TypeIndex() + +class User(BaseModel): + email = UnicodeAttribute(null=True) + Kind = UnicodeAttribute(default='user') + +class Team(BaseModel): + owner = UnicodeAttribute(null=True) + Kind = UnicodeAttribute(default='team') +``` + +## Features + +- Python >= 3.8 support +- Use of `Table` boto3 resource + - DynamoDB API `conditions` objects + - Auto-Typing +- An ORM-like interface with query and scan filters +- Compatible with DynamoDB Local +- Support for Unicode, Binary, JSON, Number, Set, and UTC Datetime attributes +- Support for Global and Local Secondary Indexes +- Automatic pagination for bulk operations(?) +- Complex queries +- Multiple models per table and deserialization into objects + +## Features not yet implemented + +- Provides iterators for working with queries, scans, that are automatically - paginated +- Iterators for working with Query and Scan operations +- Supports the entire DynamoDB API +- Full table backup/restore +- Batch operations with automatic pagination + + + + +%package -n python3-falcano +Summary: Falcano +Provides: python-falcano +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-falcano +# Falcano + +A Pythonic interface for Amazon's DynamoDB that supports Python 3 and [single-table design](https://www.alexdebrie.com/posts/dynamodb-single-table/) based on [PynamoDB](https://github.com/pynamodb/PynamoDB). + +## Installation + +```bash +pip install falcano +``` + +## Basic Usage + +Basic usage is nearly identical to `PynamoDB`. `Meta` must inherit from `Model.Meta` and `Type` must be defined for every model. + +Create a model that describes a model in your table. + +```python +from falcano.model import Model +from falcano.attributes import UnicodeAttribute + +class User(Model): + ''' + A DynamoDB User + ''' + class Meta(Model.Meta): + table_name = 'dynamodb-user' + billing_mode = 'PAY_PER_REQUEST' + email = UnicodeAttribute(null=True) + first_name = UnicodeAttribute(range_key=True) + last_name = UnicodeAttribute(hash_key=True) + Type = UnicodeAttribute(default='user') +``` + +Create the table if needed: + +```python +User.create_table(billing_mode='PAY_PER_REQUEST') +``` + +Create a new user: + +```python +user = User('John', 'Denver') +user.email = 'djohn@company.org' +user.save() +``` + +Now, search your table for all users with a last name of 'Denver' and whose first name begins with 'J': + +```python +for user in User.query('Denver', User.first_name.startswith('J')): + print(user.first_name) +``` + +Examples of ways to query your table with filter conditions: + +```python +for user in User.query('Denver', User.email.eq('djohn@company.org')): + print(user.first_name) +for user in User.query('Denver', User.email=='djohn@company.org'): + print(user.first_name) +``` + +Retrieve an existing user: + +```python +try: + user = User.get('John', 'Denver') + print(user) +except User.DoesNotExist: + print('User does not exist') +``` + +## Advanced Usage + +Indexes? No problem: + +```python +from falcano.model import Model +from falcano.indexes import GlobalSecondaryIndex, AllProjection +from falcano.attributes import NumberAttribute, UnicodeAttribute + +class ViewIndex(GlobalSecondaryIndex): + class Meta: + billing_mode = 'PAY_PER_REQUEST' + projection = AllProjection() + view = NumberAttribute(default=0, hash_key=True) + +class TestModel(Model): + class Meta(Model.Meta): + table_name = 'TestModel' + forum = UnicodeAttribute(hash_key=True) + thread = UnicodeAttribute(range_key=True) + view = NumberAttribute(default=0) + Type = UnicodeAttribute(default='test') + view_index = ViewIndex() +``` + +Now query the index for all items with 0 views: + +```python +for item in TestModel.view_index.query(0): + print(f'Item queried from index: {item}') +``` + +It's simple! + +Want to use DynamoDB local? Add a `host` name attribute and specify your local server. + +```python +from falcano.models import Model +from falcano.attributes import UnicodeAttribute + +class User(Model): + ''' + A DynamoDB User + ''' + class Meta(Model.Meta): + table_name = 'dynamodb-user' + host = 'http://localhost:8000' + email = UnicodeAttribute(null=True) + first_name = UnicodeAttribute(range_key=True) + last_name = UnicodeAttribute(hash_key=True) + Type = UnicodeAttribute(default='user') +``` + +## Single-Table Design Usage + +Want to follow single-table design with an index and rename the `Type` attribute? No problem: + +```python +from falcano.model import Model +from falcano.indexes import GlobalSecondaryIndex, AllProjection +from falcano.attributes import NumberAttribute, UnicodeAttribute + +class TypeIndex(GlobalSecondaryIndex): + class Meta: + index_name = 'Type' + billing_mode = 'PAY_PER_REQUEST' + projection = AllProjection() + Kind = UnicodeAttribute(default=0, hash_key=True) + +class BaseModel(Model): + class Meta(Model.Meta): + table_name = 'single_table' + # use the Kind attribute in place of Type for deserialization + model_type = 'Kind' + PK = UnicodeAttribute(hash_key=True) + SK = UnicodeAttribute(range_key=True) + TypeIndex = TypeIndex() + +class User(BaseModel): + email = UnicodeAttribute(null=True) + Kind = UnicodeAttribute(default='user') + +class Team(BaseModel): + owner = UnicodeAttribute(null=True) + Kind = UnicodeAttribute(default='team') +``` + +## Features + +- Python >= 3.8 support +- Use of `Table` boto3 resource + - DynamoDB API `conditions` objects + - Auto-Typing +- An ORM-like interface with query and scan filters +- Compatible with DynamoDB Local +- Support for Unicode, Binary, JSON, Number, Set, and UTC Datetime attributes +- Support for Global and Local Secondary Indexes +- Automatic pagination for bulk operations(?) +- Complex queries +- Multiple models per table and deserialization into objects + +## Features not yet implemented + +- Provides iterators for working with queries, scans, that are automatically - paginated +- Iterators for working with Query and Scan operations +- Supports the entire DynamoDB API +- Full table backup/restore +- Batch operations with automatic pagination + + + + +%package help +Summary: Development documents and examples for falcano +Provides: python3-falcano-doc +%description help +# Falcano + +A Pythonic interface for Amazon's DynamoDB that supports Python 3 and [single-table design](https://www.alexdebrie.com/posts/dynamodb-single-table/) based on [PynamoDB](https://github.com/pynamodb/PynamoDB). + +## Installation + +```bash +pip install falcano +``` + +## Basic Usage + +Basic usage is nearly identical to `PynamoDB`. `Meta` must inherit from `Model.Meta` and `Type` must be defined for every model. + +Create a model that describes a model in your table. + +```python +from falcano.model import Model +from falcano.attributes import UnicodeAttribute + +class User(Model): + ''' + A DynamoDB User + ''' + class Meta(Model.Meta): + table_name = 'dynamodb-user' + billing_mode = 'PAY_PER_REQUEST' + email = UnicodeAttribute(null=True) + first_name = UnicodeAttribute(range_key=True) + last_name = UnicodeAttribute(hash_key=True) + Type = UnicodeAttribute(default='user') +``` + +Create the table if needed: + +```python +User.create_table(billing_mode='PAY_PER_REQUEST') +``` + +Create a new user: + +```python +user = User('John', 'Denver') +user.email = 'djohn@company.org' +user.save() +``` + +Now, search your table for all users with a last name of 'Denver' and whose first name begins with 'J': + +```python +for user in User.query('Denver', User.first_name.startswith('J')): + print(user.first_name) +``` + +Examples of ways to query your table with filter conditions: + +```python +for user in User.query('Denver', User.email.eq('djohn@company.org')): + print(user.first_name) +for user in User.query('Denver', User.email=='djohn@company.org'): + print(user.first_name) +``` + +Retrieve an existing user: + +```python +try: + user = User.get('John', 'Denver') + print(user) +except User.DoesNotExist: + print('User does not exist') +``` + +## Advanced Usage + +Indexes? No problem: + +```python +from falcano.model import Model +from falcano.indexes import GlobalSecondaryIndex, AllProjection +from falcano.attributes import NumberAttribute, UnicodeAttribute + +class ViewIndex(GlobalSecondaryIndex): + class Meta: + billing_mode = 'PAY_PER_REQUEST' + projection = AllProjection() + view = NumberAttribute(default=0, hash_key=True) + +class TestModel(Model): + class Meta(Model.Meta): + table_name = 'TestModel' + forum = UnicodeAttribute(hash_key=True) + thread = UnicodeAttribute(range_key=True) + view = NumberAttribute(default=0) + Type = UnicodeAttribute(default='test') + view_index = ViewIndex() +``` + +Now query the index for all items with 0 views: + +```python +for item in TestModel.view_index.query(0): + print(f'Item queried from index: {item}') +``` + +It's simple! + +Want to use DynamoDB local? Add a `host` name attribute and specify your local server. + +```python +from falcano.models import Model +from falcano.attributes import UnicodeAttribute + +class User(Model): + ''' + A DynamoDB User + ''' + class Meta(Model.Meta): + table_name = 'dynamodb-user' + host = 'http://localhost:8000' + email = UnicodeAttribute(null=True) + first_name = UnicodeAttribute(range_key=True) + last_name = UnicodeAttribute(hash_key=True) + Type = UnicodeAttribute(default='user') +``` + +## Single-Table Design Usage + +Want to follow single-table design with an index and rename the `Type` attribute? No problem: + +```python +from falcano.model import Model +from falcano.indexes import GlobalSecondaryIndex, AllProjection +from falcano.attributes import NumberAttribute, UnicodeAttribute + +class TypeIndex(GlobalSecondaryIndex): + class Meta: + index_name = 'Type' + billing_mode = 'PAY_PER_REQUEST' + projection = AllProjection() + Kind = UnicodeAttribute(default=0, hash_key=True) + +class BaseModel(Model): + class Meta(Model.Meta): + table_name = 'single_table' + # use the Kind attribute in place of Type for deserialization + model_type = 'Kind' + PK = UnicodeAttribute(hash_key=True) + SK = UnicodeAttribute(range_key=True) + TypeIndex = TypeIndex() + +class User(BaseModel): + email = UnicodeAttribute(null=True) + Kind = UnicodeAttribute(default='user') + +class Team(BaseModel): + owner = UnicodeAttribute(null=True) + Kind = UnicodeAttribute(default='team') +``` + +## Features + +- Python >= 3.8 support +- Use of `Table` boto3 resource + - DynamoDB API `conditions` objects + - Auto-Typing +- An ORM-like interface with query and scan filters +- Compatible with DynamoDB Local +- Support for Unicode, Binary, JSON, Number, Set, and UTC Datetime attributes +- Support for Global and Local Secondary Indexes +- Automatic pagination for bulk operations(?) +- Complex queries +- Multiple models per table and deserialization into objects + +## Features not yet implemented + +- Provides iterators for working with queries, scans, that are automatically - paginated +- Iterators for working with Query and Scan operations +- Supports the entire DynamoDB API +- Full table backup/restore +- Batch operations with automatic pagination + + + + +%prep +%autosetup -n falcano-0.0.10 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-falcano -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot - 0.0.10-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..25082c1 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +472e398430a72bdf3e6ab5bb97d910c4 falcano-0.0.10.tar.gz -- cgit v1.2.3