{"uid":"cap_nfQ8t7ATWJAgeEHo2Qtkx","slug":"python-pep-508-environment-marker-typed-expression-evaluator-da41a39d","name":"Python PEP 508 Environment Marker Typed Expression Evaluator","description":"Evaluate decoded dependency markers against an explicitly supplied environment with PEP440 comparisons.","url":"https://detect.halowerk.com/v1/F-TD2000-DOCUMENTS-02/python-pep508-environment-marker-typed-expression-evaluation?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"type":"object","properties":{"artifact":{"type":"object","required":["dependencyMarkers"],"properties":{"dependencyMarkers":{"type":"object","required":["data","claim"],"properties":{"data":{"type":"object","required":["environment","nodes","root"],"properties":{"root":{"type":"integer","maximum":63,"minimum":0},"nodes":{"type":"array","items":{"anyOf":[{"type":"object","required":["op","operator","left","right"],"properties":{"op":{"const":"compare"},"left":{"type":"object","required":["kind","value"],"properties":{"kind":{"enum":["literal","variable"]},"value":{"type":"string","maxLength":128}},"additionalProperties":false},"right":{"type":"object","required":["kind","value"],"properties":{"kind":{"enum":["literal","variable"]},"value":{"type":"string","maxLength":128}},"additionalProperties":false},"operator":{"enum":["==","!=","<","<=",">",">=","~=","in","not in"]}},"additionalProperties":false},{"type":"object","required":["op","children"],"properties":{"op":{"enum":["and","or"]},"children":{"type":"array","items":{"type":"integer","maximum":63,"minimum":0},"maxItems":32,"minItems":1}},"additionalProperties":false}]},"maxItems":64,"minItems":1},"environment":{"type":"array","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string","maxLength":64},"value":{"type":"string","maxLength":128}},"additionalProperties":false},"maxItems":32,"minItems":0}},"additionalProperties":false},"claim":{"anyOf":[{"type":"null"},{"type":"object","required":["matches"],"properties":{"matches":{"type":"boolean"}},"additionalProperties":false}]}},"additionalProperties":false}},"additionalProperties":false}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_fAsRDGxxoBmoD3AihZ0p3","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Evaluates decoded PEP 508 dependency marker expressions against a supplied environment using PEP 440 version comparisons to determine if a dependency condition matches.","exampleAgentPrompt":"Evaluate this PEP 508 dependency marker expression tree — root node 0, nodes: a compare node checking if the variable 'python_version' equals the literal '3.11' — against an environment where python_version is '3.11' and sys_platform is 'linux', and tell me if the marker matches.","exampleUseCases":[{"title":"CI pipeline dependency gate check","prompt":"I have a Python package that should only be installed when python_version >= '3.10'. My CI environment has python_version set to '3.9'. Can you evaluate whether this marker matches so I know if the dependency should be installed?"},{"title":"Cross-platform package compatibility check","prompt":"Check if this dependency marker applies: the condition is sys_platform == 'win32' and python_version != '3.8'. My target environment has sys_platform as 'linux' and python_version as '3.10'. Does it match?"},{"title":"Dependency resolver marker pre-screening","prompt":"Before resolving packages, I need to know if a PEP 508 marker expression tree — with an 'or' node combining two compare nodes checking extra == 'security' and os_name == 'posix' — matches an environment where extra is 'dev' and os_name is 'posix'."}],"resultDescription":"Returns a typed claim object indicating whether the evaluated dependency marker expression tree matches the provided environment (a boolean 'matches' field), or null if no claim could be made. The result reflects PEP 440-compliant comparisons across all supplied environment variables.","failureModes":["Invalid node index references (root or children pointing to out-of-range indices)","Unsupported operator enum value in compare node","Environment variable name exceeds 64 characters or value exceeds 128 characters","Node array exceeds 64 items limit","Malformed expression tree with circular or disconnected references","Missing required fields (dependencyMarkers, data, root, nodes, environment)"],"whenToPreferThis":"Use this endpoint when you need programmatic, PEP 440-compliant evaluation of decoded PEP 508 dependency marker expression trees against an explicitly supplied Python environment. It is ideal for dependency resolvers, CI/CD pipelines, package compatibility checkers, and any agent that needs to determine whether a Python package dependency condition applies to a given runtime environment without executing Python locally.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-12-01T07:40:24.333Z","isFirstParty":false,"canonicalSlug":"python-pep-508-environment-marker-typed-expression-evaluator-da41a39d"}