Skip to content

Conversation

@WH-2099
Copy link
Contributor

@WH-2099 WH-2099 commented May 18, 2025

Close #38

core_schema.no_info_plain_validator_function(ULID),
core_schema.str_schema(pattern=r"[A-Z0-9]{26}", min_length=26, max_length=26),
core_schema.str_schema(
pattern=rf"[{base32.ENCODE}]{{26}}", min_length=26, max_length=26
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a test that would need to be adapted. Good catch with the I, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I missed this issue and I'll follow up on a fix


@staticmethod
def _gen_bytes_from_ts(ts_ms: int | None = None) -> bytes:
"""Generate a new ULID bytes from the timestamp(ms)."""
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. All the other methods use the more lengthy word "timestamp" so that I would like to keep it consistent: What do you think about _bytes_from_timestamp(...)
  2. The docstring could be "Generate a ULID byte sequence of from a timestamp"

@mdomke
Copy link
Owner

mdomke commented May 20, 2025

Please execute the tests with hatch test so that you have a shorter turnaround time

@WH-2099
Copy link
Contributor Author

WH-2099 commented May 20, 2025

Ok, sorry for the misunderstanding, it's still just part of this PR (it's not a full version)
I'll finish it as soon as I can.

@WH-2099 WH-2099 changed the title Improve init, encode, cli [DRAFT] Improve init, encode, cli May 20, 2025
@WH-2099 WH-2099 closed this Aug 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve CLI interface

2 participants