Skip to main content

Teddy is like Pandas, but Teddy loves you.

Project description

# Teddy

~~Teddy is not Pandas. Teddy is lightweight and snuggly.~~

~~Teddy is straightforward and understands you. Teddy loves you.~~

More importantly, Teddy is not ready for prime time.

## Feature overview

Teddy loves you so much, it will work with vanilla Python types.

```python
from collections
record = namedtuple
data = list()
```

## Python WTFs

### `__getattr__` also gets called for third-party AttributeErrors

Default attribute access does also forward to your `__getattr__` if a property descriptor raises
an unrelated `AttributeError`.

```
In [6]: class A:
...: @property
...: def result(self):
...: return [1,2].a
...:
...: def __getattr__(self, key):
...: print('hah')
...:

In [7]: A().result
hah
```

### `inspect.signature` doesn't get along with `@staticmethod` in custom object

```
Python 3.7.1 (default, Dec 10 2018, 22:54:23) [MSC v.1915 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import inspect

In [2]: class A:
...: @staticmethod
...: def __call__(x,y):
...: return y
...:

In [3]: inspect.signature(A())
Out[3]: <Signature (y)>

In [4]: inspect.signature(A().__call__)
Out[4]: <Signature (x, y)>
```

## TODOs

* [ ] the code could become simpler if it used key, value pairs everywhere internally?
* [ ] tests for attr_mapping
* [ ] prettyprinter is a bit meh sometimes
* [x] I need a read-only wrapper around dicts for using attrs instead of indexing.
* [x] get rid of no_value?
* [x] find another name for IndexedMapping?
* [x] support indexing by another Teddy instance or an IndexedMapping.
* [x] we need a sequential type that exposes a dict interface but stores a list internally...
* ~~[ ] figure out a structure for POPO vs other possible impls~~
* [x] add tests
* [ ] figure out a name for different kinds of predicates
* [x] add support for implicit lambdas
* [x] support for a literal function that allows for accessing any constant in a dict that has special meaning for teddy.


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

teddy-0.0.1.tar.gz (58.7 kB view details)

Uploaded Source

Built Distribution

teddy-0.0.1-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file teddy-0.0.1.tar.gz.

File metadata

  • Download URL: teddy-0.0.1.tar.gz
  • Upload date:
  • Size: 58.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for teddy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 096989089ce5766fc0de16fc219693275e38f2d0fcfc3fdbf83ccc75809cfbdb
MD5 19320403236da2f31241980898e6b360
BLAKE2b-256 39380b6405a3864669a6553f8cf2848f5930fc9f78d570fcc75bca76c5b5eda1

See more details on using hashes here.

File details

Details for the file teddy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: teddy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.1

File hashes

Hashes for teddy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 727ecf5d3f811365dce52e03de523b8e7d55b9d4d15c85a58b1926194da0d993
MD5 8e2ecbec7c68dbe90e82cc1ef2af6741
BLAKE2b-256 dbcd98a9b73a6275f0a851b66f81845ad51f50c1a3a8f0433606dc3e1ac9d219

See more details on using hashes here.

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