pyoncat 2.0__tar.gz → 2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,7 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: pyoncat
3
- Version: 2.0
3
+ Version: 2.1
4
4
  Summary: A Python Client for ONCat (the ORNL Neutron Catalog).
5
- Home-page: https://oncat.ornl.gov
6
5
  Keywords: ornl,neutron,metadata,catalog
7
6
  Author: ONCat Support
8
7
  Author-email: oncat-support@ornl.gov
@@ -14,9 +13,11 @@ Classifier: Programming Language :: Python :: 3.9
14
13
  Classifier: Programming Language :: Python :: 3.10
15
14
  Classifier: Programming Language :: Python :: 3.11
16
15
  Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Programming Language :: Python :: 3.13
17
17
  Requires-Dist: oauthlib
18
18
  Requires-Dist: requests
19
19
  Requires-Dist: requests-oauthlib
20
+ Project-URL: Homepage, https://oncat.ornl.gov
20
21
  Description-Content-Type: text/markdown
21
22
 
22
23
  Welcome to PyONCat, a Python client designed to facilitate interaction with the ONCat API.
@@ -15,7 +15,6 @@ import getpass
15
15
  import json
16
16
  import os
17
17
  import pathlib
18
- import sys
19
18
  import warnings
20
19
  import weakref
21
20
  from typing import Any, Callable, ClassVar
@@ -25,7 +24,7 @@ import requests
25
24
  import requests_oauthlib
26
25
  from requests.packages.urllib3.exceptions import InsecureRequestWarning
27
26
 
28
- __version__ = "2.0"
27
+ __version__ = "2.1"
29
28
 
30
29
  __all__ = [
31
30
  "FileSystemTokenStore",
@@ -529,16 +528,12 @@ class ONCatObject:
529
528
  "id={}".format(self._content.get("id")),
530
529
  ]
531
530
 
532
- unicode_repr = "<{} at {}> JSON: {}".format(
531
+ return "<{} at {}> JSON: {}".format(
533
532
  " ".join(ident_parts),
534
533
  hex(id(self)),
535
534
  str(self),
536
535
  )
537
536
 
538
- if sys.version_info[0] < 3:
539
- return unicode_repr.encode("utf-8")
540
- return unicode_repr
541
-
542
537
  def __str__(self):
543
538
  return json.dumps(self._content, sort_keys=True, indent=4)
544
539
 
@@ -659,8 +654,7 @@ class _ONCatResource(metaclass=_ONCatMixinMeta):
659
654
  def retrieve(self, identifier, **kwargs):
660
655
  oncat = self._parent_oncat_weakref()
661
656
 
662
- if identifier.startswith("/"):
663
- identifier = identifier[1:]
657
+ identifier = identifier.removeprefix("/")
664
658
 
665
659
  path = f"{self._NAMESPACE}/{self._RESOURCE_ENDPOINT}/{identifier}"
666
660
 
@@ -683,8 +677,7 @@ class _UpdatableONCatMixin(_ONCatResource):
683
677
  def place(self, identifier, data, **kwargs):
684
678
  oncat = self._parent_oncat_weakref()
685
679
 
686
- if identifier.startswith("/"):
687
- identifier = identifier[1:]
680
+ identifier = identifier.removeprefix("/")
688
681
 
689
682
  path = f"{self._NAMESPACE}/{self._RESOURCE_ENDPOINT}/{identifier}"
690
683
 
@@ -704,8 +697,7 @@ class _RemovableONCatMixin(_ONCatResource):
704
697
  def remove(self, identifier, **kwargs):
705
698
  oncat = self._parent_oncat_weakref()
706
699
 
707
- if identifier.startswith("/"):
708
- identifier = identifier[1:]
700
+ identifier = identifier.removeprefix("/")
709
701
 
710
702
  path = f"{self._NAMESPACE}/{self._RESOURCE_ENDPOINT}/{identifier}"
711
703
 
@@ -808,6 +800,11 @@ class Archive(
808
800
  _NAMESPACE = "api"
809
801
 
810
802
 
803
+ class Cycle(_ListableONCatMixin, _ControllerONCatMixin):
804
+ _RESOURCE_ENDPOINT = "cycles"
805
+ _NAMESPACE = "api"
806
+
807
+
811
808
  class Datafile(
812
809
  _ControllerONCatMixin,
813
810
  _CreatableONCatMixin,
@@ -7,7 +7,7 @@ build-backend = "poetry.masonry.api"
7
7
  # https://github.com/python-poetry/roadmap/issues/3
8
8
  [tool.poetry]
9
9
  name = "pyoncat"
10
- version = "2.0"
10
+ version = "2.1"
11
11
  description = "A Python Client for ONCat (the ORNL Neutron Catalog)."
12
12
  authors = ["ONCat Support <oncat-support@ornl.gov>"]
13
13
  readme = ["pyoncat/README.md", "pyoncat/LICENSE"]
File without changes
File without changes