Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
Does boto3 Bucket.object.filter retrieve object efficiently?

I want to get a list of all the objects(or max 1000) located at foo-bucket/foo-dir , e.g.

Bucket: foo-bucket

Directory: foo-dir

I see Bucket.objects boto3 API use filtering(Bucket.objects.filter)

I am wondering what it does internally? Does it list all the objects and filter? Or does AWS provide an API that takes filter arguments and return the filtered results.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The S3 API supports a prefix on the ListObjects request that will filter the responses to include only those objects whose name matches the prefix. So:

import boto3

s3 = boto3.resource('s3')
bucket = s3.Bucket('mybucket')
for obj in bucket.objects.filter(Prefix='foo/bar/fie/baz/'):
    # do something with obj here

Would only return objects whose name begins with the prefix foo/bar/fie/baz/.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda