ccptools


Nameccptools JSON
Version 1.2.0 PyPI version JSON
download
home_pageNone
SummaryThe CCP Tools team utilities for date and/or time objects and values and messing with types.
upload_time2024-05-22 13:36:10
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseMIT License Copyright (c) 2013-2024 CCP Games Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords datetimeutils datetime typeutils type singleton date time timespan tools ccp utils
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # CCP Games Python Toolkit

A smooshup of a few Python packages from the CCP Tools Team of old (Team 
Batcave).

Our two most commonly used internal packages, called `datetimeutils` and 
`typeutils` were too _generically_ named for Pypi.org and since they were 
both used in something like 80-90% of our other projects, it made sense to 
just smoosh them together in one module, and thus, the `ccptools` package 
was born.

Here's the README of the [Date Time Utils](./ccptools/dtu/README.md) submodule.

Here's the README of the [Type Utils](./ccptools/tpu/README.md) submodule.


## Date-Time Utils

The old `datetimeutils` package is now included here as the `dtu` submodule.

```python
from ccptools import dtu
```

### Changes from `datetimeutils`

The name has been shortened to `dtu` to speed up usage _(although you can 
also just go `from ccptools.dtu import *` if you wish)_.

The code has also been quite heavily refactored but everything that was 
available in `datetimeutils` 2.3.0.0 should be accessible via `ccptools.legacyapi.datetimeutils`.

That is, for a super low-effort upgrade from older `datetimeutils` version 
to the new `ccptools` package, simply replace...:

```python
import datetimeutils
```

...with...

```python
from ccptools.legacyapi import datetimeutils
```

...and everything should work fine! :)

Note that any Python 2.7 support has been removed.

### Changes from `typeutils`

The name has been shortened to `tpu` although that's more to fit in with the 
`dtu` pattern. It shouldn't really matter since `typeutils` was rarely if 
ever imported directly since it was split into multiple submodules from the 
start.

Nevertheless to accommodate any changed from `typeutils` 3.5.0.0 and ease 
migration over to `ccptools` the old API is aliased in 
`ccptools.legacyapi.typeutils`.

So you can simply replace

```python
from typeutils import metas
```

...with...

```python
from ccptools.legacyapi.typeutils import metas
```

...and everything should work fine! :)

Note that any Python 2.7 support has been removed.

## Structs

Importing `*` from the `structs` submodule will import all of the most 
commonly used imports in our projects:
```python
from typing import *  # For type annotation

import abc  # For interfaces (Abstract Base Classes)
import dataclasses  # For dataclass structs
import decimal  # Used whenever we're handling money
import enum  # Also used for struct creation
import logging  # Used pretty much everywhere
import re  # Used surprisingly frequently
import time  # Very commonly used
```

Note that datetime is not included in this. That's because tt'll also import 
the aliases from the Datetime Utils (`ccptools.dtu.structs.aliases`) 
package instead:

```python
Date = datetime.date
Time = datetime.time
Datetime = datetime.datetime
TimeDelta = datetime.timedelta
TzInfo = datetime.tzinfo
TimeZone = datetime.timezone
```

Furthermore, it'll also include a few of the most commonly used utility 
classes from the Type Utils submodule:

- The `Singleton` Meta Class 
- The `Empty` and `EmptyDict` classes as well as the `if_empty` method
- The `EnumEx` base class for Enums with the `from_any` class method

So in most cases we can cover something like 90% of any imports we tend to 
need in every Python file with a single line:

```python
from ccptools.structs import *
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ccptools",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "datetimeutils, datetime, typeutils, type, singleton, date, time, timespan, tools, ccp, utils",
    "author": null,
    "author_email": "Thordur Matthiasson <thordurm@ccpgames.com>, John Aldis <johnaldis@ccpgames.com>",
    "download_url": "https://files.pythonhosted.org/packages/cc/e7/90e70cac856b9c61ce0501d2de76ec42959778ff817c50840bdada420911/ccptools-1.2.0.tar.gz",
    "platform": null,
    "description": "# CCP Games Python Toolkit\n\nA smooshup of a few Python packages from the CCP Tools Team of old (Team \nBatcave).\n\nOur two most commonly used internal packages, called `datetimeutils` and \n`typeutils` were too _generically_ named for Pypi.org and since they were \nboth used in something like 80-90% of our other projects, it made sense to \njust smoosh them together in one module, and thus, the `ccptools` package \nwas born.\n\nHere's the README of the [Date Time Utils](./ccptools/dtu/README.md) submodule.\n\nHere's the README of the [Type Utils](./ccptools/tpu/README.md) submodule.\n\n\n## Date-Time Utils\n\nThe old `datetimeutils` package is now included here as the `dtu` submodule.\n\n```python\nfrom ccptools import dtu\n```\n\n### Changes from `datetimeutils`\n\nThe name has been shortened to `dtu` to speed up usage _(although you can \nalso just go `from ccptools.dtu import *` if you wish)_.\n\nThe code has also been quite heavily refactored but everything that was \navailable in `datetimeutils` 2.3.0.0 should be accessible via `ccptools.legacyapi.datetimeutils`.\n\nThat is, for a super low-effort upgrade from older `datetimeutils` version \nto the new `ccptools` package, simply replace...:\n\n```python\nimport datetimeutils\n```\n\n...with...\n\n```python\nfrom ccptools.legacyapi import datetimeutils\n```\n\n...and everything should work fine! :)\n\nNote that any Python 2.7 support has been removed.\n\n### Changes from `typeutils`\n\nThe name has been shortened to `tpu` although that's more to fit in with the \n`dtu` pattern. It shouldn't really matter since `typeutils` was rarely if \never imported directly since it was split into multiple submodules from the \nstart.\n\nNevertheless to accommodate any changed from `typeutils` 3.5.0.0 and ease \nmigration over to `ccptools` the old API is aliased in \n`ccptools.legacyapi.typeutils`.\n\nSo you can simply replace\n\n```python\nfrom typeutils import metas\n```\n\n...with...\n\n```python\nfrom ccptools.legacyapi.typeutils import metas\n```\n\n...and everything should work fine! :)\n\nNote that any Python 2.7 support has been removed.\n\n## Structs\n\nImporting `*` from the `structs` submodule will import all of the most \ncommonly used imports in our projects:\n```python\nfrom typing import *  # For type annotation\n\nimport abc  # For interfaces (Abstract Base Classes)\nimport dataclasses  # For dataclass structs\nimport decimal  # Used whenever we're handling money\nimport enum  # Also used for struct creation\nimport logging  # Used pretty much everywhere\nimport re  # Used surprisingly frequently\nimport time  # Very commonly used\n```\n\nNote that datetime is not included in this. That's because tt'll also import \nthe aliases from the Datetime Utils (`ccptools.dtu.structs.aliases`) \npackage instead:\n\n```python\nDate = datetime.date\nTime = datetime.time\nDatetime = datetime.datetime\nTimeDelta = datetime.timedelta\nTzInfo = datetime.tzinfo\nTimeZone = datetime.timezone\n```\n\nFurthermore, it'll also include a few of the most commonly used utility \nclasses from the Type Utils submodule:\n\n- The `Singleton` Meta Class \n- The `Empty` and `EmptyDict` classes as well as the `if_empty` method\n- The `EnumEx` base class for Enums with the `from_any` class method\n\nSo in most cases we can cover something like 90% of any imports we tend to \nneed in every Python file with a single line:\n\n```python\nfrom ccptools.structs import *\n```\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2013-2024 CCP Games  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "The CCP Tools team utilities for date and/or time objects and values and messing with types.",
    "version": "1.2.0",
    "project_urls": {
        "Changelog": "https://github.com/ccpgames/ccptools/blob/main/CHANGELOG.md",
        "Documentation": "https://github.com/ccpgames/ccptools/blob/main/README.md",
        "Homepage": "https://github.com/ccpgames/ccptools",
        "Issues": "https://github.com/ccpgames/ccptools/issues",
        "Repository": "https://github.com/ccpgames/ccptools.git"
    },
    "split_keywords": [
        "datetimeutils",
        " datetime",
        " typeutils",
        " type",
        " singleton",
        " date",
        " time",
        " timespan",
        " tools",
        " ccp",
        " utils"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "86ff028ac6de1a9b6112cdf2bb4b1e7431a1a7c4970e2b588eafe8392396e5f7",
                "md5": "07f160b03d10fbe32c290c7802c62735",
                "sha256": "52e7bc73d9bc6fbc743e9795b2b497580ebc37d3b8b82f958ea960cf345b4b69"
            },
            "downloads": -1,
            "filename": "ccptools-1.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "07f160b03d10fbe32c290c7802c62735",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 67235,
            "upload_time": "2024-05-22T13:36:08",
            "upload_time_iso_8601": "2024-05-22T13:36:08.610519Z",
            "url": "https://files.pythonhosted.org/packages/86/ff/028ac6de1a9b6112cdf2bb4b1e7431a1a7c4970e2b588eafe8392396e5f7/ccptools-1.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cce790e70cac856b9c61ce0501d2de76ec42959778ff817c50840bdada420911",
                "md5": "cb51a0d7ba1139de6f26e799a7c53d96",
                "sha256": "f18f78c4ab146ce681e5e4c13804eec760cd5b8de41aabd7bdea1839b4935334"
            },
            "downloads": -1,
            "filename": "ccptools-1.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cb51a0d7ba1139de6f26e799a7c53d96",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 48184,
            "upload_time": "2024-05-22T13:36:10",
            "upload_time_iso_8601": "2024-05-22T13:36:10.562085Z",
            "url": "https://files.pythonhosted.org/packages/cc/e7/90e70cac856b9c61ce0501d2de76ec42959778ff817c50840bdada420911/ccptools-1.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-22 13:36:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ccpgames",
    "github_project": "ccptools",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "ccptools"
}
        
Elapsed time: 0.29186s