semvec/pypi-packages huggingface dataset:
cos202finalbycharawi 0.0.3
vectors and points by Charawi Detphumi
License: MIT
Keywords: Point,Mathematics,Vector,Charawi

cos202finalbycharawi
====================

cos202finalbycharawi is a Python library for dealing with points and
vectors.

Installation
------------

Use the package manager `pip <https://pip.pypa.io/en/stable/>`__ to
install cos202finalbycharawi.

.. code:: bash

   pip install cos202finalbycharawi

Usage
-----

.. code:: python

   from cos202finalbycharawi import Vector

   v1 = Vector(1,2)
     v2 = Vector(3,4)
     print(v1)
     print(v2)
     v1.euclideandistance(v2)
     print(v1.lenght())
     print(v1.unit())
     print(v1.dotproduct(v2))
     #print(v1.crossproduct(v2))
     print(v1+v2)
     print(v1-v2)
     print(v1*v2)
     print(v1/v2)

Contributing
------------

Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.

Please make sure to update tests as appropriate.

Author
------

Charawi Detphumi

License
-------

`MIT <https://choosealicense.com/licenses/mit/>`__
crudal 0.3.1
CRUD operations for SQLAlchemy models
License: MIT
Requires Python: >=3.8,<4.0

# CRUDAL

Ready to use CRUD methods for SQLAlchemy models. Both *Sync* and *Async*

```
pip install crudal
```

# Examples



## Sync


### Model initialization

```python
from crudal import DeclarativeCrudBase

from sqlalchemy import Integer, String, create_engine
from sqlalchemy.orm import Mapped, mapped_column, sessionmaker

engine = create_engine("sqlite://")
SessionLocal = sessionmaker(engine, expire_on_commit=False)


class User(DeclarativeCrudBase):
    __tablename__ = "person"
    __session__ = sessionmaker(engine, expire_on_commit=False)

    id: Mapped[int] = mapped_column(Integer, primary_key=True)
    name: Mapped[str] = mapped_column(String, nullable=False)


DeclarativeCrudBase.metadata.create_all(bind=engine)
```
### Add new item

```python
user = User(name="Andrew")
user.add()
```

### Find item

Find all users with name equals *Andrew*
```python
users_found = User.find(name="Andrew")
for u in users_found:
    assert u.name == "Andrew"
```

### Update item

Change name of all users with name *Andrew* to *John*

```python
User.update(session=session, values=dict(name="John"), name="Andrew")
```

### Delete item

```python
User.delete(name="John")
```

## Async



```python
from crudal import DeclarativeCrudBaseAsync

from sqlalchemy import Integer, String, create_engine
from sqlalchemy.orm import Mapped, Session, mapped_column


class User(DeclarativeCrudBaseAsync):
    __tablename__ = "person"

    id: Mapped[int] = mapped_column(Integer, primary_key=True)
    name: Mapped[str] = mapped_column(String, nullable=False)

```

## Find

```python

with Session(bind=engine) as session:
    p = User(name="Andrew")
    p.add(session=session)

    p2 = User(name="Bob")
    p2.add(session=session)

    # find person with name "Andrew"
    andrew = User.find(session=session, name="Andrew")

    all_users = User.all(session=session)

    for u in all_users:
      print(u.name)

```


###