Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Add is_synapse_id to the client #948

Closed
vpchung opened this issue Feb 27, 2023 · 0 comments · Fixed by #950
Closed

[Feature request] Add is_synapse_id to the client #948

vpchung opened this issue Feb 27, 2023 · 0 comments · Fixed by #950

Comments

@vpchung
Copy link
Member

vpchung commented Feb 27, 2023

Feature Request

Add a helper function to the client that will allow checking whether a given string is a valid Synapse ID. A "valid" synID must:

  • have the expected format of syn[0-9]+
  • be linked to an actual Synapse entity, that is, "syn123" is not a real Synapse entity

Expected behavior

Return True/False whether a given synID is valid. Something like this:

>>> is_synapse_id("test")
False
>>> is_synapse_id("123")
False
>>> is_synapse_id("syn123")
False
>>> is_synapse_id("syn123abc")
False
>>> is_synapse_id("syn28590455")
True
>>> is_synapse_id("syn22392179")
True

Request Motivation

One of our collaborators for a challenge wants to implement a check in their workflow to ensure given IDs are valid Synapse IDs. I suggested the utils function, is_synapse_id, but after some digging, realize that this function is more for testing the client, rather than for users to use.

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 a pull request may close this issue.

1 participant