> **Note**
>
> For the **Full Changelog** see: https://github.com/TDKorn/my-magento/compare/v2.0.1...v2.1.1
* Added get_api() to log in easier using credentials stored in environment variables
* The environment variables ``MAGENTO_USERNAME``, ``MAGENTO_PASSWORD``, ``MAGENTO_DOMAIN`` will be used if the ``domain``, ``username`` or ``password`` kwargs are missing
python
import magento
>>> magento.get_api()
2023-02-08 03:34:20 INFO |[ MyMagento | 127_user ]|: Authenticating user on 127.0.0.1/path/to/magento
2023-02-08 03:34:23 INFO |[ MyMagento | 127_user ]|: Logged in to user
<magento.clients.Client object at 0x000001CA83E1A200>
* Added ``local`` kwarg to ``Client`` to support locally hosted Magento stores and test environments
* By default, ``local=False``
python
from magento import Client
>>> api = Client("127.0.0.1/path/to/magento", "username", "password", local=True)
* Add since() and until() method to SearchQuery classes, which searches the ``created_at`` field
* They can be chained together and also with add_criteria()
python
Retrieve orders from the first 7 days of 2023
>>> api.orders.since("2023-01-01").until("2023-01-07").execute()
[<Magento Order: 000000012 placed on 2023-01-02 05:19:55>, ]
python
Retrieve orders over $50 placed since 2022
>>> api.orders.add_criteria(
... field="grand_total",
... value="50",
... condition="gteq"
... ).since("2022-01-01").execute()
[<Magento Order: 000000003 placed on 2022-12-21 08:09:33>, ...]
* Changed add_criteria() to auto-increment the filter group by default if no group is specified (ie. ``AND`` condition)
python
Retrieving products that are over $10 AND in the category with id 15